It's kinda simple I think.
Essentially, is this possible
1 | local random = math.random( 10 , 15 ) |
2 |
3 | -- use random later |
4 |
5 | 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:
1 | 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;
1 | 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 :).