What I want is, when my timer gets to zero, they get tp'd to a different map, but for some reason it is not working, they are both in different scripts. My timer script works though.
TP SCRIPT
while true do local players = game.Players:GetPlayers() if game.Workspace.Message.Text = "0" = true do players.Character:MoveTo(game.Workspace.Map2.Position) end
TIMER SCRIPT
print "Mosski123's timer script has loaded..." wait(2) print "Starting timer..." wait(2) print "Timer started..." while true do -- While true do statement. for test1 = 60, 1, -1 do test2 = Instance.new("Hint", workspace) test2.Text = "This current countdown has " ..test1.. " seconds left." wait(1) game.Workspace.Message:remove() end end
amount=0 if amount==0 then -- must have a then print'0' end
This prints 0
because the amount
is 0, if I had amount=1
the script will print false
or nil
. If you want to compare between 2
numbers then we would use the Less than
and More than
symbol.
amount=1 if amount<2 then print'too small' end
if you're accessing the player through a localscript
then you use the localplayer
local player=game.Players.LocalPlayer
this will only work on a localscript
, now for a script(if you are using one), you could by using the PlayerAdded
event.
game.Players.PlayerAdded:connect(function(player) -- the player that entered print(player.Name) end)