Theres no output I'm trying to get the player removing to work this is a tycoon I want it so if that player leaves it resets the tycoon Ive asked this several times I need help
function onTouch(hit)
local name = hit.Parent.Name
local player = hit.Parent
local plr = hit.Parent:FindFirstChild("Humanoid")
if plr then
local check1 = game.Players:GetPlayerFromCharacter(hit.Parent)
if check1 then
local check2 = check1:WaitForChild("leaderstats")
if check2 then
local check3 = check2:WaitForChild("Owner")
if check3.Value == false then
check3.Value = true
script.Parent.CanCollide = false
script.Parent.Transparency = 1
print(hit.Parent)
local model = script.Parent.Parent
model.Name = name.." Owns This Tycoon"
local green = game.Teams.GreenTeam
check1.TeamColor = BrickColor.new("Lime green")
local h = player:FindFirstChild("Humanoid")
if h then
h.Health = 0
game.Players.PlayerRemoving:connect(function(player)
if player == false then
check3.Value = false
model.Name = "Become Owner"
script.Parent.CanCollide = false
script.Parent.Transparency = 1
end
end)
end
end
end
end
end
end
script.Parent.Touched:connect(onTouch)

2 comments
I should just quit making my game if I added you oin team create could you help me out that way like its ok if you don't want to ill make sure I add you as a scripting helper I really want to make this then you can see everything
Sure. I'd be glad to help. I've never used Team Create before, though.