It has nothing in the console, I am so confused, it doesn’t print, doesn’t do anything I am just tryin gto open a door
local TouchPart = script.Parent:FindFirstChild("TouchPart")
if TouchPart == nil then
warn("Missing touch part")
end
local groupId = script:GetAttribute("groupId")
local groupId2 = script:GetAttribute("groupId2")
local groupRank = script:GetAttribute("groupRole")
local groupRank2 = script:GetAttribute("groupRole2")
local blastDoorTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0.5)
-- Functions --
function TweenDoor (targetedDoor, tweenInfo, targetedDoor2)
print("Worked!")
local blastTween = TweenService:Create(targetedDoor, tweenInfo, {Position = targetedDoor.Position + Vector3.new(0, targetedDoor.Size.Y, 0)})
blastTween:Play()
end
TouchPart.Touched:Connect(function(hit)
local player = Players:GetPlayerFromCharacter(hit.Parent or hit.Parent.Parent)
if player then
if groupId and groupId2 ~= 0 then
if player:IsInGroup(groupId) and player:IsInGroup(groupId2) then
if groupRank ~= 0 then
if player:GetRankInGroup(groupId) >= groupRank then
if groupRank2 ~= 0 then
if player:GetRankInGroup(groupId2) >= groupRank then
TweenDoor(script.Parent:WaitForChild("Door"), blastDoorTweenInfo)
end
end
end
end
end
elseif groupId ~= 0 then
if groupRank ~= 0 then
if player:GetRankInGroup(groupId) >= groupRank then
TweenDoor(script.Parent:WaitForChild("Door"), blastDoorTweenInfo)
end
else
TweenDoor(script.Parent:WaitForChild("Door"), blastDoorTweenInfo)
end
end
end
end)