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

Why does this script only work for the person that clicked the text button?

script.Parent.MouseButton1Down:Connect(function()
	for i, v in pairs(game.Players:GetPlayers()) do
		local playergui = v:FindFirstChild("PlayerGui")
		if playergui then
			local gui = v:WaitForChild("PlayerGui")
			if gui then
				local Hoh = gui:WaitForChild("#HOH")
				if Hoh then
					Hoh.LocalScript.Disabled = false
				end
			end
		end
	end
end)

I looped through all the players once I click a text button. The local script is suppose to make a gui tween across the screen for everyone. I tried it and it only tweens across the screen for the person that clicked the text button. Its like it completely ignored the loop that makes it tween across the screen to everyone. Anyone got any answers? I am really really confused.

1 comment

0

PlayerGui can only be accessed by the LocalPlayer. I would suggest making the LocalScript fire a RemoteEvent with :FireAllClients and then listening for that on every client, connected to an event that tweens the gui.

1 answer

You should probarly use a remote that fires all clients, a serverscript cant access the playergui

1 comment

0

how do i do that?

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