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

How do I make a GUI popup for everyone?

Hello! I am trying to make a GUI that pops up for everyone once this button is clicked. The buttons script is

(Local Script)

script.Parent.MouseButton1Click:Connect(function()
    game.ReplicatedStorage.AddPoints:FireAllClients()
end)

RemoteEvent is located in ReplicatedStorage, called AddPoints

In ServerScriptStorage I have this, its called AddPoints

(Regular Script)

game.ReplicatedStorage.AddPoints.OnServerEvent:Connect(function()
    game.StarterGui.AddPoints.Frame.Visible = true
    game.StarterGui.AddPoints.Frame:TweenPosition(UDim2.new(.419,0,.5,0))
end)

I keep getting this error

Image "" failed to load: Unexpected URL FireAllClients can only be called from the server -StackBegin
-Script 'Players.DennisSense.PlayerGui.AddThese.Frame.TextButton.AddPoints', Line2
-StackEnd

1 comment

0

You can only call fireallclients from the server. What exactly are you trying to do?

1 answer

✓ Accepted answer

local script

script.Parent.MouseButton1Click:Connect(function()
    game.ReplicatedStorage.AddPoints:FireServer()--u need to tell the server to do something, a client cant tell other clients anything, it have to go through the server
end)

server script

game.ReplicatedStorage.AddPoints.OnServerEvent:Connect(function(player)--if u want to check who the player is
for i,v in pairs(game.Players:GetPlayers()) do--this for loop goes through every single player
v.PlayerGui.AddPoints.Frame.Visible = true
v.PlayerGui.AddPoints.Frame:TweenPosition(UDim2.new(.419,0,.5,0))--these 2 is all players and will do those 2 things on all players playergui
end
end)

1 comment

1

Thank you so much! It worked!!! :)

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