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

Why isn't my VIP script working?

Asked by 10 years ago
 local vipmembers = {"Roboy5857", "tyresse"}
vip = game.Workspace.VIPDoor

function onTouched(vip)
    if vipmembers:onTouched(vip) then
        vip.Transparency = 1
        vip.CanCollide = false
        wait(2)
        vip.Transparency = 0
        vip.CanCollide = true
    end
end

script.Parent.Touched:connect(onTouched)

When I go online.. it doesn't work. Why?

0
Why did i get a vote down. My question is fine. Roboy5857 20 — 10y
0
About to answer. (Just voted you up to reset it back to 0) Shawnyg 4330 — 10y
0
Thanks Roboy5857 20 — 10y

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

Put this script in the door.

VIP_Members = {"Roboy5857", "tyresse"}
door = script.Parent
door.Touched:connect(function(hit)
    if hit.Parent and hit.Parent:findFirstChild("Humanoid") and game.Players:GetPlayerFromCharacter(hit.Parent) then
        p = game.Players:GetPlayerFromCharacter(hit.Parent)
        for i,v in pairs(VIP_Members) do
            if p.Name == v then
                door.Transparency = 0.7
                door.CanCollide = false
                wait(0.5)
                door.Transparency = 0
                door.CanCollide = true
            end
        end
    end
end)

~ Thank me by accepting this answer/bumping up my reputation.

0
Thanks it works!! :D Roboy5857 20 — 10y
0
Mind accepting the answer? Shawnyg 4330 — 10y
Ad

Answer this question