Hi, i made a script where it changes his team to the lobby on death. But it doesn't work. Can anyone help?
--//Objects\\--
local intermission = 30
local roundtime = 120
local players = game:GetService("Players")
local gun = game.ReplicatedStorage.TrenchGun
local claws = game.ReplicatedStorage.Claws
local wwpackage = game.ReplicatedStorage.Werewolf
local lteam = game.Teams.Lobby
local wteam = game.Teams.Werewolf
local hteam = game.Teams.Hunters
local message = Instance.new("Hint")
message.Parent = workspace
local gamestarted = false
local songs = game.ReplicatedStorage.Songs:GetChildren()
--//Functions\\--
function FindIndex(Table,Val)
for index,v in pairs(Table) do
if v == Val then
return index
end
end
end
--//Main\\--
game:GetService('Players').PlayerAdded:Connect(function(player) -- the broken part
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
print(player.Name .. " has died!")
player.Team = lteam
end)
end)
end)

1 comment
Thank you, this works!