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

Why did my door script stop working all of a sudden?

Asked by 6 years ago

So I have a house system that when you click a door you purchase a house(you pay some money, the owner stringvalue's value gets changed to your name) and when you touch the door, it opens it up. Everything worked fine until the last update I made where I added some furniture to the house. Nothing else. No script changes. Any idea why? Here's the code:

owner = script.Parent.Parent:WaitForChild("Owner")

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        print("There's a Humanoid")
        if hit.Parent.Name == owner.Value then
            print("It's the owner")
            script.Parent.Transparency = 0.5
            script.Parent.CanCollide = false
            print("Door open")
            wait(5)
            script.Parent.Transparency = 0
            script.Parent.CanCollide = true
            print("Door close")
        end
    end
end)

It doesn't even print "There's a Humanoid".

0
Maybe there are multiple stuff called "Owner"? royee354 129 — 6y
0
What is the parent of your door? royee354 129 — 6y
0
A model called House bruceywayne 35 — 6y
0
And there is only one string value named Owner bruceywayne 35 — 6y
View all comments (5 more)
0
check your model User#17685 0 — 6y
0
I did... bruceywayne 35 — 6y
0
And there is a value in the house? royee354 129 — 6y
0
Check if there are multiple values like "Owner" in the house royee354 129 — 6y
0
Everything is fine. Just the script doesn't work. bruceywayne 35 — 5y

Answer this question