Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is there a way to improve this?

storage = game.ReplicatedStorage
backpack = game.Players.LocalPlayer.Backpack
math.randomseed(tick())

storage["Kagune" .. tostring(math.random(8))]:clone().Parent = backpack

This script randomly clones a script in Replicated Storage and put it in your backpack

It works but it seems to base the randomisation on timezones for example: If two people lived in Europe they'd get the same script however I want it to be completely random, help me improve this?

2 comments

1

you making a Tokyo Ghoul type of thing?

0

Yep

1 answer

✓ Accepted answer

Assuming the Kagunes are placed in the root ReplicatedStorage by itself, you can do this.

storage = game:GetService("ReplicatedStorage")
backpack = game.Players.LocalPlayer.Backpack
--not sure why you had the tick, cause you didn' really use it in the provided script. if you used it for something else, you can add it back in.

local kagunes = storage:GetChildren()

local newkagune = storage["Kagune" .. tostring(math.random(1, #kagunes))]:clone()
newkagune.Parent = backpack

1 comment

0

Thanks, I had to change "#kagunes" to the maximum amount of kagunes I had in storage

This discussion is preserved as it was. New answers, comments, and votes are closed.