Log in to vote

How to Make a 2X chance to teleport a specific player?

Asked by 21 days ago

Hello. I have another scripting question. So, I have gotten help and managed to make a random player picker, and make that random player chosen teleport on the stage and do whatever for 100 seconds, then teleport back to spawn. However, I want to make a 2X chance to go on stage if that player pays 1000 points. So basically, I made a frame inside of starter GUI, which contains a text button that says, " 2X CHANCE TO GO ON STAGE" and when you press it, it checks if you have 1000 points, and if you do, it takes them away, just like if you payed for it, then I want to make the 2X chance basically give that specific player who payed the 1000 points have a double chance to go on stage. I ALSO HAVE A LEADERSTAT SET UP ALREADY.

Here is the script to get on stage, and after 100 seconds, you get teleported back to spawn:

task.wait(12) -- `task.wait` is the "updated" version of `wait` and is more precise
local num = math.random(1, #game.Players:GetChildren())
local player = game.Players:GetChildren()[num]

local hrp = player.Character.HumanoidRootPart
hrp.CFrame =, 26.652, 95.261)) -- Teleport to where you wanted
task.wait(100) -- Wait 100 Seconds
    hrp.CFrame =, 23.642, 93.177)) -- Teleport back to spawn
    until false

If you do not understand or have a question about this, please ask so.

Thanks, from Cubispaghettis.

This script wasn't completely made by me, by the way. Its the script that I had made with help. Cubispaghettis 1 — 21d

1 answer

Log in to vote
Answered by 21 days ago

You can try looping the player table and if the person has the 2x clone their position in the table

if 2x then
    table.insert(players, player)
where would i place that script? Cubispaghettis 1 — 21d
It would be in the script to get on stage shinyshadowguy7 0 — 19d

Answer this question