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

RemoteEvent to change multiple players' TeamColor will not work, why?

Asked by 5 years ago

So I have a server script in a model that when the model is touched, a value is put into another model inside that one that displays the player name. The script that I have includes it getting the players and then firing a FireClient to a PlayerGui that then changes the players team. Everything I did seems correct but it still will not work. This is the server script in the model:

for i,v in pairs(model.PlayersTouching:GetChildren()) do
    if v:FindFirstChild("PlayerGui") then
            v.PlayerGui.ChangeTeamEasy.TeamChangeEasy:FireClient(v)
    end
end

This is the Local Script inside the PlayerGui that includes the RemoteEvent inside of it with the following script:

local player = game.Players.LocalPlayer

script.TeamChangeEasy.OnClientEvent:Connect(function()
    player.TeamColor = BrickColor.new("Sea green")
end)
0
Where is the RemoteEvent located? Pojoto 329 — 5y
0
Put the event in ReplicatedStorage MahadTheIronSword 98 — 5y
0
When I tried to make a RemoteEvent Fire using a Touched Event it didn't work, but the MouseButton1Click did. I think you need to do something else to Fire it ... TheOnlySmarts 233 — 5y

Answer this question