So when someone on the "Admin/VIP" table joins the game this TextButton shows up only for that person. I've made this script where if you click the TextButton it should disable another gui FOR EVERYONE!

script.Parent.MouseButton1Click:Connect(function(plr)
	for _,v in pairs(game.Players:GetPlayers()) do
		v.PlayerGui:WaitForChild("ScreenGui").Spawn.TextButton.Text = "Disabled"
		v.PlayerGui.ScreenGui.Spawn.TextButton.LocalScript.Disabled = true
	end
end)

5 comments

0

This is a Local Script? If yes, change to a normal script

0

@Leamir TextButton Events should be kept on the client/Local scripts. Use remote events to communicate to the server that then tells the other clients to disable the gui.

0

This is a local script but I just don't know how to reference everyones PlayerGui.

0

son i know what a remote function is... I just don't know how to access everyones playergui from a server script