Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a tycoon Owner Only Door?

Asked by 7 years ago

I'm trying to make a tycoon owner only door with Berezaa's tycoon kit. This is what I have and I don't want it to kill :/ If anyone can help, then thanks.

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
                end
            end
        end
        script.Parent.Touched:connect(onTouched)

0
Btw, it doesn't make CanCollide = false. It just stays true. qualitygamesdotinc 0 — 7y
0
The problem doesn't look to be in this particular code. The door probably doesn't have the correct name, as in line 6 and 8, or you are trying to access the wrong item at 2 and 5. SquirreIOnToast 309 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Probably the best way is to go to models and search for "Zednov's Tycoon Kit." (or another) and find his door and copy and paste his script for his door on to your script...and make sure to modify it to fit your titles....im new or i would be able to help more.

Ad

Answer this question