So I'm trying to making a teleport upon death script for my friend's TSK group, and I keep getting error
12:09:15.386 - Workspace.Script:4: attempt to index local 'game' (a nil value)
and I'm not sure why, please help me fix this.
game:GetService('Players').PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid").Died:connect(function()
game.Players.player.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(0, 500000, 0))
end)
end)
end)
Appreciate any help given :)

1 comment
game may not be the problem, it may be something else, it happens a lot