Log in to vote

How can you create an algorithm that places something randomly?

Asked by 1 month ago

Hey, I'm working on a game where there are always two buttons at the bottom that are supposed to have random text on them, but that's another question, the question of this thread is how do I make it so that when I press it at the bottom and it says for example "Ice" and I press it and it first fetches the part from the replicated storage and then places it randomly any where on the map?

1 answer

Log in to vote
Answered by 1 month ago

First of all, your supposed to try and make the script yourself. Secondly, don't use replicated storage, their is server storage for a reason. Now I am going to give you the script but next time actually try and do it yourself...

I am guessing you want the player to press a TextButton.

local original = game.ServerStorage.Ice

    local copy = original:Clone()
    copy.Parent = game.Workspace
    copy.Position =,0,math.random(100))

This is a Server Script inside of the TextButton.

This is completely random, if you rather have set spawns but still random go here

Ay man thanks im trying to learn scripting and did not know fully where to start thats why still thanks. Hallohallo98 2 — 1mo

Answer this question