Hey!
As you can see in the scripts below, I’m trying to display the name of a player that says the ‘!pts’ command and triggers the RemoteEvent on the GUI that pops up, but I’m unsure how to transfer it from the server script to the local script and it’s currently showing the localplayers’ name. If I haven’t explained this well enough, let me know below and I’ll provide some further clarity on it. Thanks for everyone who’s trying to help!
ServerScript:
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(Message)
if Message == "!pts" then
game.ReplicatedStorage.PTSRequestGrant:FireAllClients(Player.Name)
end
end)
end)
LocalScript:
local player = game.Players.LocalPlayer
game.ReplicatedStorage.PTSRequestGrant.OnClientEvent:Connect(function()
local frameclone = player.PlayerGui.PTSDisplayer.HolderFrame.SampleFrame:Clone()
frameclone.Parent = script.Parent.HolderFrame
frameclone.Visible = true
frameclone.Text = player.Name.." has requested PTS!"
end)