My code is a followup to a basic admin command I made. Chefs can use a !unlock command with the argument being user, and it will remove a forcefield for the player. What I have done so far is making a script that gives each player a boolvalue titled "forcefield" when they join that is automatically set to true. The unlock command sets the target user's forcefield to false. What I want is when a player touches the door, it checks if their boolvalue is FALSE, and if it is false it lets the player through by turning off cancollide. It is not working though. (The script is inside of the door)
local door = script.Parent
local function dothis(otherPart)
if otherPart.Parent.forcefield.Value == false then
script.Parent.CanCollide = false
print("permission")
else
print("no permission")
end
end
door.Touched:Connect(dothis)
Keep in mind I did check the command's code and the "on join script"'s code and they both working fine. The only hang up is the doors script.
