Teleporter random number generation is broken

I have a game that teleports a player to a random map each time a button is pressed. I noticed that each time, the game gives me the same map (there are only 2 right now), and if I want a different map, I have to close and reopen the game. (I’d suggest using an API from something like random.org to generate the random numbers.)
EDIT: @Chrisostom gave me a good solution (thank you), but I’m not marking this as ‘resolved’ because the bug still exists.
EDIT 2: I should also mention that I use RNG for the power-ups, and that works normally.

Welcome to the forums @NoNoWahoo remember to read:https://forum.creative.gimkit.com/faq

1 Like

How are you calling the random teleportation?

Can you send an image of your code? I haven’t personally run into this before.

If you aren’t gonna help don’t send comment, like welcoming is fine and all but if you’re just gonna ditch after that that’s rude

2 Likes

I think he just means can you teleport anywhere>

Read my post again, I asked for a screenshot of the block code not the j0in code

1 Like

I think that you are only running the RNG once, you need to run the RNG system every time the button is pressed.

oh ok, just elaborate that it’s a block code next time.

ok

No I’m lazy and it’s inferred from context.
Anyway, @NoNoWahoo can I see a screenshot of the code you’re using?

2 Likes

I have a button that activates a zone. The zone transmits a channel to all players in it, which teleports them to one of two teleporters.

I’m not using code, I’m just having two teleporters with the same group.

Maybe teleporter RNG is handled differently than normal RNG?

Potentially, but the teleporter RNG is still broken. EDIT: It is. I use regular RNG in another place, and it’s not broken (I think).

So, just to recap, the RNG can send someone to either map, but it only sends people to one per game?

1 Like

Yes. If the game is ended and restarted, it still only sends people to that specific map. (That’s the only way the bug would occur, as people can only go to one map per game.)

And I have no idea how to do it using normal RNG.

welcome @NoNoWahoo to the forums!
also maybe trying using triggers.

use code!

button, trigger and 2 teleporters

button: default settings (change the interface if you want)
trigger: go to blocks and press "when triggered
Create a variable and make the code look like this

then go to the teleporters
tele 01: teleport here when receiving on channel “map 1”
tele 02: teleport here when receiving on channel “map 2”

now wire the button to the trigger: button pressed – trigger

2 Likes

From Past Experiences (And Unless Gimkit Fixed It) Using 2 Teleports With The Same Group Isn’t Random, It Will Always Teleport You To The Closest Teleporter With The Group Name.

3 Likes