I am trying to make a staff only door that is connected to my group. So basically in my game, there will be a door where only certain ranks in the group are able to join. So for example the ranks are Friends and above. This is the local script im using. (And yes the door is checked for collide)
if not game:IsLoaded() then
game.Loaded:Wait()
end
pcall(function()
if game.Players.LocalPlayer:GetRankInGroup(7063801) >= 99 then
warn(true)
for i,v in pairs(workspace.StaffDoor:GetChildren()) do
v.CanCollide = false
end
end
end)
It wont let me enter the door, what is the mistake?
Try doing warn(tostring(true)) or warn('true'). I don’t think anything aside from a string can be outputted. Also, for future reference, maybe use the code formatting the forum has, and provide an output error if there is one.
For the loop, check if it’s a BasePart, as @codyorr4 said.
for i,v in pairs(workspace.StaffDoor:GetChildren()) do
if v:IsA('BasePart') then
v.CanCollide = false
end
end