So basically when a player touches a certain part, I check if the player is on a certain team, and if they are, fire a remote event to the client and from there change text on the billboard gui. Unfortunately, it didn’t work, so I thought, should I use a bindable event instead and change the text from the server? Or should I still change the text from the client. (The reason I’m changing the text from the client is because I only want the text to change for one person.) If you need more details, here are my scripts
-- serverscript in part
game.ReplicatedStorage.JoinAteam.OnServerEvent:Connect(function(player)
script.Parent.Touched:Connect(function()
if player.Team.Name == "Bob" then
game.ReplicatedStorage.Terminate:FireClient(player)
end
end)
end)
-- local script in starter gui
local Tag = game.ReplicatedStorage.NameTag
local Term = Tag.UpperUpperText
game.ReplicatedStorage.Terminate.OnClientEvent:Connect(function(player)
Term.Text = "T"
end)
something triggers the remote → the touched event can now run → if the thing that touched the part is in team ‘bob’ → Fire another remote event, this time to the client → from the client change the name tag
script.Parent.Touched:Connect(function()
game.ReplicatedStorage.JoinAteam.OnServerEvent:Connect(function(player)
if player.Team.Name == "Bob" then
game.ReplicatedStorage.Terminate:FireClient(player)
end
end)
end)
It means it thought Team is a child. To fix this, get the player from the 1st parameter of Touched:
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not player then return end
if player.Team.Name == "Bob" then
game.ReplicatedStorage.Terminate:FireClient(player)
end
end)
I don’t get what you are trying to do, as your only problem is not being able to fire the RemoteEvent. If it is not related to the current problem, it should go to another topic.