Can anyone tell me where it is going wrong? The error is on line 28.
GroupID = 4057855
Door = script.Parent
Kill = false
Teleport = false
X = 0
Y = 0
Z = 0
DB = false
script.Parent.Touched:connect(function(p)
if p.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(p.Parent)
if player then
if not DB then
DB = true
if player:GetRankInGroup(GroupID) >=3 then
if not Teleport then
Door.Transparency = 0.4
Door.CanCollide = false
wait(0.3)
Door.Transparency = 0
Door.CanCollide = true
DB = false
elseif Teleport then
player.Character.Torso.CFrame = CFrame.new(X,Y+2,Z)
DB = false
end
elseif not player:GetRankInGroup(GroupID) >=3 then
if Kill then
p.Parent.Humanoid.Health = 0
DB = false
elseif not Kill then
DB = false
end
end
end
end
end
end)

1 comment
The (not) checks the value for true/false only. You would do if player:GetRankInGroup(GroupID) < 3 then...