Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What variable do you do to get a player?

It's a 1 man server this script is a server script and i'm trying to destroy the players gui which is "wave" Why isn't this working?

game.Players:FindFirstChildOfClass("Player").PlayerGui.Wave:Destroy()

3 answers

✓ Accepted answer

Try this. It should work.


for i,v in pairs(game.Players:GetPlayers()) do
	
	local PlayerGui = v.PlayerGui
	PlayerGui.Wave:Destroy()
end

2 comments

0

Thx ill try it

0

Thx ill try it

Hello! You could try this:

game.Players:GetChildren().PlayerGui.Wave:Destroy()

hope it helps!

1 comment

0

Sorry it didn't work

Try this:

game.Players.LocalPlayer.PlayerGui.Wave:Destroy()

1 comment

0

As he stated, it's in a Server Script. You cannot get the local player inside of a Server Script. So this would not work.

This discussion is preserved as it was. New answers, comments, and votes are closed.