Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Why isn't my VIP script working?

Asked by 6 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 — 6y
0
About to answer. (Just voted you up to reset it back to 0) Shawnyg 4246 — 6y
0
Thanks Roboy5857 20 — 6y

1 answer

Log in to vote
0
Answered by
Shawnyg 4246 Trusted Badge of Merit Snack Break Moderation Voter Administrator Community Moderator Super Administrator
6 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 — 6y
0
Mind accepting the answer? Shawnyg 4246 — 6y
Ad

Answer this question