Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Wont remove the Gui after wait(3)?

Asked by 7 years ago
Edited 7 years ago

Loader:

function onPlayerEntered(plr)
        print("Player Added")
workspace.Intro:Clone().Parent = plr.PlayerGui
end
game.Players.PlayerAdded:connect(onPlayerEntered)
        print("Loaded Intro")

Remover:

wait(3)
PlayerGui.Intro:Destroy()

For some reason this is not working, help?

0
First off... 'AdvancedCode' l0l thehybrid576 294 — 7y
0
Whats wrong with my name AdvancedCode 136 — 7y
0
Nothing. It's a better name than "thehybrid576" lol NecoBoss 194 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago

You can add a few WaitForChild's so it would work in the game and you can combine the Loader and Remover.

Please explain if this is a script or local script

If script use this code; Note: Make sure that the Intro Gui is in replicated Storage

game.Players.PlayerAdded:connect(function(Plr)
    print("PlayerAdded")
    game.ReplicatedStorage:WaitForChild("Intro"):Clone().Parent = plr.PlayerGui
    print("Intro Cloned")
    wait(HOWLONG YOU WANNA WAIT)
    plr.PlayerGui:WaitForChild("Intro"):Destroy()
end) -- May or may not have to remove ")"
0
It is a Script, your code does not work either. AdvancedCode 136 — 7y
0
I also removed the ")" to troubleshoot and did other things as well however they did not work. AdvancedCode 136 — 7y
0
No the ")" stays there because you are using an anonymous function. Your first line should be: game.ReplicatedStorage.Intro:Clone().Parent = plr.PlayerGui NecoBoss 194 — 7y
0
Also change that wait time to 5 NecoBoss 194 — 7y
View all comments (3 more)
0
Still does not work. AdvancedCode 136 — 7y
0
I fixed it now, thanks! AdvancedCode 136 — 7y
0
Np BlackOrange3343 2676 — 7y
Ad
Log in to vote
0
Answered by 7 years ago

Put the brackets after Destroy

0
That's what I think aswell PhoenixVortex_RBLX 33 — 7y
0
Forgot to paste that in, yeah. AdvancedCode 136 — 7y

Answer this question