Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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.

4 comments

0

G = Group ID

0

R = Rank #

0

That should help you immensely.

2 answers

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".

This discussion is preserved as it was. New answers, comments, and votes are closed.