So I am using Berezaa's Tycoon kit and I have been making a owner only door and I don't know what is wrong with the script. The script has 3 Parents OwnerOnlyDoor, then Purchases, and then there is Bright Blue where there is a Owner Value. That means there is 3 Parents so I edited it to three parents and also the Value is called Owner not OwnerName so I changed that to Owner and it still wont work. It may be because the type of value the Owner is a Object Value idk. If you can help me out please!!! My script:
function onTouched(hit)
local owner = script.Parent.Parent.Parent.Owner
local h = hit.Parent:findFirstChild("Humanoid")
if (h ~= nil) then
if h.Parent.Name == owner.Value then
script.Parent.CanCollide = false
wait(2)
script.Parent.CanCollide = true
else h.Health = 0
end
end
end
script.Parent.Touched:connect(onTouched)
THANKS!

1 comment
Make sure that 'Owner' is a StringValue, other than that.. your script looks fine.