Hello, I am new to verse and have a question that should be pretty simple, but I wasn’t able to find any solutions to upon searching. In a creative device verse script I would like to save my player’s agent in order to be able to use it with an ItemGranter’s GrantItem(agent) function. However, I can’t figure out how to initialize this variable correctly. In a class that isn’t a creative device, I can initialize Agent: agent with no problems, but once I try to initialize this variable in a creative device, all sorts of errors pop up. In addition, it would be great if someone could show me how to fetch the player agent in the OnBegin() function. Any help would be greatly appreciated, thank you!
OnBegin<override>()<suspends>:void=
AllPlayers : []player = GetPlayspace().GetPlayers()
if(Player : player = AllPlayers[0], Character: fort_character = Player.GetFortCharacter[]):
``
This gets all the players in the game and a single Fortnite character associated with the only player in the game.
This video might help too, as far as dealing with the Agent type alone.
[Agent](https://youtu.be/B5clQLD_icg?si=BoUpCOJ2fSi3XP8F)
Agent or Player
See if this video helps any.
This is exactly what I was looking for, thank you!
1 Like
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.