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

Can someone take a look at the script and tell me if it's correct or not?

Asked by
xAdxn 2
5 years ago
Edited 5 years ago

I'm trying to make a door that will allow multiple ranks to go in it. Line 9, isn't working. It worked with three of my ranks but it won't work with the rest of my ranks. (All six of them). Note: Picture line 9 as a straight line. (I already fixed the missing or, but it still won't work). Here's the link to the script: https://pastebin.com/FwCwdGTQ

0
its blocked Gameplayer365247v2 1055 — 5y
0
Oops, here's the actual one. https://pastebin.com/FwCwdGTQ xAdxn 2 — 5y
0
You're missing an or between plr:GetRoleInGroup(4875330) == '14 | Advisor' and plr:GetRoleInGroup(4875330) == '13 | Executive' Ankur_007 290 — 5y
0
I know, I already fixed that. But it still isn't working, xAdxn 2 — 5y
0
Btw, remember to accept my answer, thanks Prestory 1395 — 5y

1 answer

Log in to vote
0
Answered by
Prestory 1395 Moderation Voter
5 years ago

There is an easier way of doing this you can just use > symbol instead of checking every rank through the script using GetRankInGroup

local groupId = 4875330
local door = script.Parent
local debounce = false
local Rank = 250

door.Touched:connect(function(part)
    local plr =  game.Players:GetPlayerFromCharacter(part.Parent)
    if plr then
        if plr:IsInGroup(4875330) then
        if (plr:GetRankInGroup(groupId) >= Rank) and not debounce then
                    debounce = true
                    door.Transparency = 0.5
                    door.CanCollide = false
                    wait(1)
                    door.Transparency = 0
                    door.CanCollide = true
                    debounce = false
            end
        end
    end
end)
Ad

Answer this question