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

I need help with a Remote event script?

Hello,

I want to do so if someone click on a button his username will come up on a gui so everyone in the server can see,

This is the scirpt i using now;

script.Parent.RemoteEvent.OnServerEvent:connect(function(player)
game:GetService("ServerStorage"):WaitForChild("Tool"):Clone().Parent = player.Backpack
player.PlayerGui.ScreenGui.Frame.TextLabel.Text = player.Name
Local Script;

script.Parent.MouseButton1Click:connect(function(plr)
game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent"):FireServer()
end)

1 comment

0

the problem is at line 3 in the server script, you are changing the text only on the player's gui not on everyone else's.

2 answers

I believe this may be the fix. If you have any issues with it or it doesn't fix the issue, let me know. Thanks!

script.Parent.RemoteEvent.OnServerEvent:connect(function(player)
game:GetService("ServerStorage"):WaitForChild("Tool"):Clone().Parent = player.Backpack
for Index, Plr in pairs (game:GetService("Players"):GetChildren()) do -- cycle through player's etc
	Plr.PlayerGui.ScreenGui.Frame.TextLabel.Text = player.Name.
end

You could use an Event to fire all clients and send the player's name through a parameter.I think...

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