Where did you put the script then?
StarterCharacterScripts (extra letter)
Error = CanCollide is not a valid member of Model “Workspace.TeamDoor” - Client - LocalScript:8
it might be because it’s not a part or smth?
local player = game.Players.LocalPlayer
local teams = game:GetService("Teams")
local TeamDoor = workspace:FindFirstChild("TeamDoor")
local function ChangeCollisionProperty()
for _,part in TeamDoor:GetDescendants() do
if part:IsA("BasePart") then
part.CanCollide = player.Team ~= teams.Business
end
end
end
ChangeCollisionProperty()
player:GetPropertyChangedSignal("Team"):Connect(ChangeCollisionProperty)
There
Then your team isn’t the right one.
local player = game.Players.LocalPlayer
local teams = game:GetService("Teams")
local TeamDoor = workspace:FindFirstChild("TeamDoor")
local function ChangeCollisionProperty()
for _,part in TeamDoor:GetDescendants() do
if part:IsA("BasePart") then
part.CanCollide = player.Team ~= teams.Business and player.Team ~= teams.Comfort
end
end
end
ChangeCollisionProperty()
player:GetPropertyChangedSignal("Team"):Connect(ChangeCollisionProperty)
I also joined thru every team and still didn’t work
well aren’t you a helpful one
it’s good to see you socialize!
riiiight
are you suuureee your teams are correct?? is the player on the right team?
can you put some sort of print into that function just incase it doesn’t work?
damn she replied before me
that is infact, not inside the function!
local player = game.Players.LocalPlayer
local teams = game:GetService("Teams")
local TeamDoor = workspace:FindFirstChild("TeamDoor")
local function ChangeCollisionProperty()
print("smth") -- I've moved the print statement inside this function
for _,part in TeamDoor:GetDescendants() do
if part:IsA("BasePart") then
part.CanCollide = player.Team ~= teams.Business and player.Team ~= teams.Comfort
end
end
end
ChangeCollisionProperty()
player:GetPropertyChangedSignal("Team"):Connect(ChangeCollisionProperty)
Alright test this:
local player = game.Players.LocalPlayer
local teams = game:GetService("Teams")
local TeamDoor = workspace:FindFirstChild("TeamDoor")
local function ChangeCollisionProperty()
for _,part in TeamDoor:GetDescendants() do
if part:IsA("BasePart") then
print("huh")
part.CanCollide = not (tostring(player.Team) == "Business" or tostring(player.Team) == "Comfort")
end
end
end
ChangeCollisionProperty()
player:GetPropertyChangedSignal("Team"):Connect(ChangeCollisionProperty)
still not working eqeqqdwdqwewqedqsdq
I think you are wrong. It works. I tested it myself around 5 seconds ago.
Can you show me where the script is placed?
Place it in StarterPlayerScripts.
still not working i’m literally ramming the door
i’m just grasping straws here
are you ABSOLUTELY sure the player is on the RIGHT team??
literally sometihng wrong on your side