[SOLVED] How do I whitelist collision for the listed player

  1. I want to make this door (red part) whitelisted to where the collision is off for the listed player.

  2. I am stuck on how to script the door.

  3. I’ve tried the local = whitelist method and it did not work unfortunately.

-- local whitelist = {"t_skeei"}

if whitelist == true then
	
	script.Parent.CanCollide.ForStaff.DOOR = false
	wait()
end

Screenshot 2023-01-09 111251

well this script wont work because a player name cannot be a bool value to check if it is true

hello i have found some problems with your scripts and this could
help you alot
liek this

--you can make a function play to see if the part is hit and the name is t_skeei
function touched(hit)
if hit.Parent.Name = "t_skeei" then  --checks if the hits name is t_skeei
script.Parent.CanCollide.ForStaff.DOOR = false
end
script.Parent.Touched:Connect(touched)

it basically checks the hit.Name and if it is t_skeei then it opens the door

if i understood correctly you are trying to make custom collisions for an exact person
so it would be like this

 local whitelist = {"username",--[[you can add more]]}
local DoorCollisionToTurnOff = Instance
for i,whitelisted in pairs(whitelist) do
if game.Players.LocalPlayer.Name ==  whitelisted then	
	DoorCollisionToTurnOff.Collision = false -- Change path
	task.wait() -- suggested to be more fast
end
end

Edit : you need to make this a local script in starter gui and change the path selected of the door because it wont work if you dont

1 Like

try this:

local whitelisted = "playername"
local door = game.Workspace.door

door.Touched:Connect(function(hit)
  if hit.parent.Name == whitelisted
  door.CanCollide = false
end)

this wouldnt work as hit could also be the leg of the player

yes i noticed that made it if the parents name is t_skeei

for this its saying something like Forstaff is not valid.

as i said you need to change the path of the door because the script’s path is now changed into local and into a other parent thats why.

It worked! thank you so much!! :smiley:

No problem have fun developing charchar

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.