local ElevatorPlayers = game.ReplicatedStorage.Players.PlayerValue.Value
local Liftsound = script.Parent.LiftSound
local Hitbox = script.Parent.Hitbox
local tp = workspace.tPoints:FindFirstChild("TpPoint")
Players = 0
-- PlayerValueGiver
local function AddPlayer()
Hitbox.Touched:Connect(function()
Players = Players + 1
hit.Parent:moveTo(teleport.Position)
end)
-- Elevator Main
while true do
wait()
if Players >= 1 then
print("test")
end
end
end
COMMUNITY QUESTION
How to fix this Loop that is not printing While i have no output error?
1 answer
Hello, hokyboy!
local ElevatorPlayers = game.ReplicatedStorage.Players.PlayerValue.Value
local Liftsound = script.Parent.LiftSound
local Hitbox = script.Parent.Hitbox
local tp = workspace.tPoints:FindFirstChild("TpPoint")
local Players = 0
-- PlayerValueGiver
local function AddPlayer()
Hitbox.Touched:Connect(function()
Players = Players + 1
hit.Parent:moveTo(teleport.Position)
end -- This end was at the wrong location...
end)
-- Elevator Main
while true do
wait()
if Players >= 1 then
print("test")
end
end
Don't forget that you have to close all functions on your code
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
why do you have 3 ends on the loop? You should only have 2
If i remove one it gives me an error