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
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