No- I'm not really asking for something that basic.
Basically, what I'm trying to do is when the player clicks the button, it determines a random number (currently between 1 and 4, though I want to add more) and if the number is 1, it teleports them one place, if its 2 then it teleports them to another place, and so on.
local i = math.random(4)
if 1 then
game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(154.8, 5, -167.8)
end
if 2 then
game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(-37, 5, 0)
end
if 3 then
game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(197, 5, 154)
end
if 4 then
game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(-99, 5, -217)
end
wait(1)
end
What (i think) the problem is is that the game reads that i = 4 instead of whatever random number it is, but I dont know how to fix it... it always teleports me to option 4
Help please :o

1 comment
Thank you!! I tried putting i = 1 at first but it wouldnt allow it, I didn't know that it had to have to ==! thank you sooo much :D