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

If players in the group above role 3 walk through this, its cancollide false?

Asked by 8 years ago

So heres my code

local G = 2695224
local R = 3

function onTouched(player)
    if player ~= nil and player:IsInGroup(G) and player:GetRankInGroup(G) >= 3 then

    end
end

And what do I put to make it so some players can walk through a wall but others can't. It has something to do with Current Camera.

0
G = Group ID iSidersz 70 — 8y
0
R = Rank # iSidersz 70 — 8y
0
That should help you immensely. Discern 1007 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago

Try to make a script that is like the example on this link:

Then, put that script in ServerStorage. Then, make your group script clone the script and put the clone in the player's backpack.

Ad
Log in to vote
0
Answered by 8 years ago

I made this script as if what you try to do is to make someone able to pass through an object, a door.

permission = {"Player1"}-- list of account names allowed to go through the door.  need to be the correct name (If the name is Hello, and you write 'hello' it wont allow him.

function checkOkToLetIn(name) 
    for i = 1,#permission do 
        if (string.upper(name) == string.upper(permission[i])) then return true end 
    end 
    return false 
end 

local Door = script.Parent

function onTouched(hit) 
    print("Door Hit") 
    local human = hit.Parent:findFirstChild("Humanoid") 
    if (human ~= nil ) then 

        print("Human touched door") 

        if (checkOkToLetIn(human.Parent.Name)) then 
            print("Human passed test") 
            Door.Transparency = 0.8 
            Door.CanCollide = false 
            wait(3.0) --this is how long it will be in CanCollide false
            Door.CanCollide = true 
            Door.Transparency = 0 
        else
        end 
    end 
end 

script.Parent.Touched:connect(onTouched)

That one was to make specific person to get through.

You have to put the script inside the "door".

Answer this question