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

How can I make my Owner Only Door work?

Asked by 10 years ago

So I am using Berezaa's Tycoon Kit and I am trying to make a Owner Only Door but there is a small problem. Most Tycoon use a Value named OwnerName but Berezaa uses just Owner. When I use my edited script it does absolutely nothing! My script:

function onTouched(hit)
    local owner = script.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)

When I check it in game the output says this: -- Owner is not a valid member of model --Script'workspace.berezaa's tycoon kit.BrightBlue.pruchases.owner0',Line2 --Stack end -- Disconnected because of exception Please help if you can!

0
Can you give us the hierarchy of the model this script is in? It appears that the script stops because there is no item named "Owner" in the model. IcyArticunoX 355 — 10y
0
Well the script is in a model called OwnerOnlyDoor, that model is in purchases and purchases is in the Bright Blue model where the Owner value is in TixyScripter 115 — 10y

Answer this question