Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help with a Remote event script?

Asked by 6 years ago
Edited 6 years ago

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)
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. Elixcore 1337 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago

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
Ad
Log in to vote
0
Answered by 6 years ago

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

Answer this question