I have a door script that works completely fine until I had an if statement on which team the player is in. I've tried and I feel like this would make sense but it doesn't work.
local ts = game:GetService("TweenService")
local tweeninfo2 = TweenInfo.new(3.75)
local goalA = {}
goalA.Position = Vector3.new(-67.107, 14.625, -17.316)
local tweenA = ts:Create(script.Parent, tweeninfo2, goalA)
local goalB = {}
goalB.Position = Vector3.new(-67.107, 21.875, -17.316)
local tweenB = ts:Create(script.Parent,tweeninfo2, goalB)
local opened = false
script.Parent.ClickDetector.MouseClick:Connect(function(player)
local Team = game:GetService("Teams")["Administrator"]
if player.Team == Team then
print(player.Name)
print(player.Name .. " is an Administrator.")
opened = true
script.Parent["Sliding door 2"].Playing = true
tweenB:Play()
wait(7)
script.Parent["Sliding door 2"].Playing = true
tweenA:Play()
wait(1)
opened = false
end
end)

3 comments
Its still not working. :/
I added a print thing after the function above local Team. To print the players name and it does print it but it doesn't do anything in the if statement
Alright for some reason it wasn't working on ROBLOX Studio but it works in ROBLOX player so thank you!