Okay, so I am currently making a Tycoon for a game, but the Become Owner script won't make me owner. I believe it has something to do with the on touched function. Can someone help me find the problem in this script? The Hierarchy is Script>Head>Become Owner>Factory>TycoonMaker>Workspace
local ting = 0
owner = script.Parent.Parent.Parent.OwnerName
function onTouched(hit)
if ting == 0 then
ting = 1
local check = hit.Parent:FindFirstChild("Humanoid")
if check ~= nil then
local thisplr = game.Players:findFirstChild(hit.Parent.Name)
if (thisplr~=nil) then
local ownstyc = thisplr:findFirstChild("Tycoon")
if (ownstyc~=nil) then
if ownstyc.Value == 0 then
ownstyc.Value = 1
owner.Value = thisplr.Name
local message = script.Parent.NoticeTycoon:Clone()
message.Box.Label.Text = "You Now own a this tycoon."
message.Parent = thisplr.PlayerGui
wait(2)
message:remove()
repeat
wait()
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,-0.1,0)
until script.Parent.Position.Y < -5
script.Parent.Parent:remove()
elseif ownstyc.Value == 1 then
local message = game.Lighting.NoticeTycoon:Clone()
message.Box.Label.Text = "You already own a tycoon."
message.Parent = thisplr.PlayerGui
wait(3)
message:remove()
end
end
end
end
ting = 0
end
end
script.Parent.Touched:connect(onTouched)

3 comments
Don't you need another Parent? and why not just put your username into that space?
Its for a multiplayer tycoon, and if I put my username in it it wont work for others.
Any errors?