When someone dies in my game they are supposed to switch to the opposite but i cant seem to figure out why they dont
this part is in a local script
local player = game.Players.LocalPlayer
local humanoid = player.Character:WaitForChild("Humanoid")
humanoid.Died:connect(function()
game.ReplicatedStorage.playerDeath:FireServer(player)
end)
ive got the part below in server script storage
game:GetService("Teams")
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
intermission = false
local Infected = "Camo"
local non_Infected = "Black"
teamInfected = Teams.Infected
teamNonInfected = Teams.nonInfected
local Teams = game:GetService("Teams")
if intermission == true then
game.Players.PlayerAdded:Connect(function(player)
player.team = teamNonInfected
end)
else
game.Players.PlayerAdded:Connect(function(player)
player.team = teamInfected
end)
end
game.ReplicatedStorage.playerDeath.OnServerEvent:Connect(function(player)
print ("pp")
player.team = teamInfected
end)
