Make player invisible

Hello everyone, I’m terrible at Verse and I don’t know this language (like any other) from the word at all, I want to make the player invisible for a while when buying in Vending Machine, I reviewed everything I found on YouTube and on this forum, but it didn’t help, there are always some problems.

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

power_invisible := class(creative_device):

    @editable
    Trigger : trigger_device = trigger_device{}

    BuyPowerInvisible(Agent:agent): void=
        if (InvisiblePlayer := Agent, FortCharacter := InvisiblePlayer.GetFortCharacter[]):
            FortCharacter.Hide()
            spawn:
                LostPowerInvisible(FortCharacter)

    LostPowerInvisible(FortCharacter : fort_character)<suspends> : void =
        Sleep(10.0)
        FortCharacter.Show()


    OnBegin<override>()<suspends>:void=
        Trigger.TriggeredEvent(BuyPowerInvisible)

In the BuyPowerInvisible, put a ? before the agent (th elowercase one) since Triggers can be triggered by stuff like water (which isn’t an agent), you need to put the question mark.
Then, you need to add a ? after the Agent in the line

InvisiblePlayer := Agent?

That way you get the Agent if a player triggered the trigger and make them invisible :smiley:

Thanks PiEqualsThree, but

You have to type}

Trigger.TriggeredEvent.Subscribe(BuyPowerInvisible)

You don’t have the Subscribe part in your code

Thanks! That’s help me. <3

Is there a way to make only the character invisible, while their weapon stays visible?