local gate = game.Workspace:FindFirstChild("Gate")
local debounce = false
game.Players.PlayerAdded:Connect(function(player)
local role = player:GetRankInGroup(3736685)
if role >= 168 then
player.Chatted:Connect(function(message)
if message == ":open gate" then
print("Player commands to open the gate.")
for i,v in pairs(gate:GetChildren()) do
print("A")
if v:IsA("Part") and debounce == false then
debounce = true
local info = TweenInfo.new(3, Enum.EasingStyle.Sine, Enum.EasingDirection.In, false, 0)
local tween = game:GetService("TweenService"):Create(v,info,{Position = Vector3.new(v.Position.X,v.Position.Y-15,v.Position.Z)})
tween:Play()
end
end
end
if message == ":close gate" then
print("Player commands to close the gate.")
for i,v in pairs(gate:GetChildren()) do
if v:IsA("Part") and debounce == true then
debounce = false
local info = TweenInfo.new(3, Enum.EasingStyle.Sine, Enum.EasingDirection.In, false, 0)
local tween = game:GetService("TweenService"):Create(v,info,{Position = Vector3.new(v.Position.X,v.Position.Y+15,v.Position.Z)})
tween:Play()
end
end
end
end)
end
end)
It goes till the print("A").

1 comment
I fixed it.