So basically when a player click a Gui button, it fires a remote event and this script receives it and waits until a player touches that part, and if a player does, it checks if that player is in a certain team. then it should fire a bindable event, but thats not happening.
-- serverscript part
game.ReplicatedStorage.JoinAteam.OnServerEvent:Connect(function(player)
script.Parent.Touched:Connect(function()
if player.Team == "i" then
game.ReplicatedStorage.Terminate:Fire()
print("ya")
end
end)
end)
game.ReplicatedStorage.JoinAteam.OnServerEvent:Connect(function(player)
script.Parent.Touched:Connect(function()
if player.Team == "i" then
game.ReplicatedStorage.Terminate:Fire()
print("ya")
end
end)
end)
idk if thats the issue but it seems pretty problematic.
If you dont know what I did, you missed a " after “i”
I don’t believe this is a very good way to check a player’s team. There are two ways to check a player’s team: you check a player’s teamcolor like this…
if player.TeamColor = BrickColor.new("a good color") then
or
if player.Team = game:GetService("Teams").i -- i is whatever team it maybe