I was trying to get a working tycoon door script when my script stopped working! Can someone help me detect the problem?
local Owner = script.Parent.Parent.Parent.Parent.OwnerName
local Debounce = false
function GetOwner(player)
if Debounce == false then
Debounce = true
local Human = player.Parent:FindFirstChild("Humanoid")
if Human ~= nil then
local User = game.Players:GetPlayerFromCharacter(player.Parent)
if User ~= nil then
local Tycoon = Character:FindFirstChild("Tycoon")
if Tycoon ~= nil and Tycoon.Value == false then
if Owner.Value == "" then
Tycoon.Value = true
Owner.Value = Character.Name
wait(2.5)
script.Parent.Parent:remove()
Debounce = false
end
end
end
end
end
end
script.Parent.Touched:connect(GetOwner)

1 comment
My idea is to have a brick that when touched, it will change the user's Tycoon value to true, and also change the Owner value to the user's name