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?
✓ ANSWER ACCEPTED
How can you create an algorithm that places something randomly?
1 answer
✓ Accepted answer
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
script.Parent.MouseButton1Down:Connect(function(click)
local copy = original:Clone()
copy.Parent = game.Workspace
copy.Position = Vector3.new(math.random(100),0,math.random(100))
end)
This is a Server Script inside of the TextButton.
This is completely random, if you rather have set spawns but still random go here https://devforum.roblox.com/t/randomizing-position/352863
This discussion is preserved as it was. New answers, comments, and votes are closed.

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