It's kinda simple I think.
Essentially, is this possible
local random = math.random(10,15) -- use random later hum.WalkSpeed = hum.WalkSpeed - random
That's first of all.
Second of all, will that variable stay as one assigned variable? Say, if math.random pulls out 14, will it stay as 14 when I do:
hum.WalkSpeed = hum.WalkSpeed - random
In addition, if this is in a function which only runs when it's hit, does random change again?
Thanks!
Yes it is possible, but I would advise you to add this;
math.randomseed(tick())
on the very top of your script. This code will randomize your math.random()
code and not make it the same everytime.
I do not know about the Second of all, will that variable stay as one assigned variable? Say, if math.random pulls out 14, will it stay as 14 when I do: but adding math.randomseed(tick())
on the very top of your script helps a lot. Hope this helped :).