As I'm making a game, I need to make a teleport pad, but that teleport pad should teleport players to random spots within a certain area. I know how to tp a player from the tp pad to one single spot, but don't know how to randomize where they get teleported to if they touch the same block. My script looks like this;
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild('Humanoid')then hit.Parent.HumanoidRootPart.CFrame = CFrame.new(-1396.246, 21.25, 580.245) end end)
So, anyone please explain how to tp people from one teleport pad to multiple other blocks
Yes, have a table containing all the possible spots:
possibleLocations = {game.Workspace.Spot1, game.Workspace.Spot2}
inside your for loop pick a random position by saying
pickedLocation = possibleLocations[math.random(1,#possibleLocations)]
then set the characters cframe to picked locations CFrame.