Once the player dies they spawn on this brick but I want it to immediately teleport them back to their planet if their Owned Tycoon value in leaderstats is = to 1.
How would I do that if scripts cant work in server mode using "LocalPlayer"?
It works in studio mode but not in server mode. i need it to work in server mode!
Here is my original script --
script.Parent.Touched:connect(function(hit)
if game.Players.LocalPlayer.leaderstats.HasTycoon.Value == 1 then
if hit.Parent.Humanoid ~= nil then
hit.Parent.Torso.CFrame = CFrame.new(54, -38.5, 1518)
end
end
end)

2 comments
this should be done on the server using the event http://wiki.roblox.com/index.php?title=API:Class/Player/CharacterAdded
^ Use the CharacterAdded event and possibly an 'if' statement to check if the Player owns a tycoon.