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

Whats wrong with this dorm Room Script?

Asked by
IcyEvil 260 Moderation Voter
10 years ago

Im trying to make it, where it Inserts the player who touched the Brick 'Invisi' into a list that will allow it to open the door, and it isnt Letting me, No errors.

function onClicked (playerWhoClicked)
    local owner = { }
for _,v in pairs(game.Workspace.floor:GetChildren()) do
v["Claim Dorm"].Invisi.Touched:connect(function(hit)
    for _,l in pairs(game.Players:GetChildren())do
        if hit.Parent then
            local humanoid = l.Character:findFirstChild("Humanoid")
            if humanoid then
                script.Parent.Parent.Name = l.Name.."'s Dorm"
                table.insert(l.Name, #owner)
            end
            end
    end
    script.Parent.CanCollide = false
    script.Parent.Parent["Smooth Block Model"].CanCollide = false
    wait(5)
    script.Parent.CanCollide = true
    script.Parent.Parent["Smooth Block Model"].CanCollide = true
end)
end


end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

Answer this question