# Can someone please help me fix my verse code?

**URL:** <https://forums.unrealengine.com/t/can-someone-please-help-me-fix-my-verse-code/2055392>\
**Category:** Verse\
**Tags:** unreal-engine, unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [October 6, 2024, 5:50am UTC](https://forums.unrealengine.com/t/can-someone-please-help-me-fix-my-verse-code/2055392 "2024-10-06T05:50:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SonicGamez2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SonicGamez2](https://forums.unrealengine.com/u/SonicGamez2)\
**Post date:** [October 6, 2024, 5:50am UTC](https://forums.unrealengine.com/t/can-someone-please-help-me-fix-my-verse-code/2055392/1 "2024-10-06T05:50:38Z")

</div>

So I’m trying to make a verse code that is only attaching props and devices to ONE player when they pick up a Vfx powerup. but when I tested it with multiple people it attached to all of them and was very glitchy and moving everywhere. but I just want ONE player at a time for it to be attached to every time the Vfx powerup is picked up. Also, for it to stop attaching to the player if they are eliminated

My code:

using { /Fortnite.com/Devices }  
using { /Verse.org/Simulation }  
using { /UnrealEngine.com/Temporary/Diagnostics }  
using { /Fortnite.com/Characters }  
using { /UnrealEngine.com/Temporary/SpatialMath }

# A Verse-authored creative device that can be placed in a level

AttachPlayer := class (creative\_device):  
@editable MutatorZone : mutator\_zone\_device = mutator\_zone\_device{}  
@editable VFXPowerup : visual\_effect\_powerup\_device = visual\_effect\_powerup\_device{}  
@editable ExplosiveDevice : explosive\_device = explosive\_device{}  
@editable WhiteDisk : creative\_prop = creative\_prop{}  
@editable VFXSpawner : vfx\_spawner\_device = vfx\_spawner\_device{} # aAdd the radio device  
@editable VFXCreator : vfx\_creator\_device = vfx\_creator\_device{}

```
OnBegin<override>()<suspends>:void=
    VFXPowerup.ItemPickedUpEvent.Subscribe(AttachToPlayer)

AttachToPlayer(Agent : agent) : void=
    spawn:
        AttachToPlayerNew(Agent)

AttachToPlayerNew(Agent: agent)<suspends> : void=
    if(FC := Agent.GetFortCharacter[]):
        loop:
            Sleep(0.1)
            PlayerPos := FC.GetTransform().Translation
            PlayerRot := FC.GetTransform().Rotation
            spawn{WhiteDisk.MoveTo(PlayerPos + vector3{Z:= -70.0},PlayerRot, 0.1)}
            spawn{MutatorZone.MoveTo(PlayerPos, PlayerRot, 0.1)}
            spawn{ExplosiveDevice.MoveTo(PlayerPos + vector3{Z:= 120.0}, PlayerRot, 0.1)}
            spawn{VFXSpawner.MoveTo(PlayerPos + vector3{Z:= 70.0},PlayerRot, 0.1)} # Move the radio device
            spawn{VFXCreator.MoveTo(PlayerPos + vector3{Z:= 120.0}, PlayerRot, 0.1)}

```
