Jump to content

Recommended Posts

On the simplest level how would I make a prefab spawn lets say a rock, at a random time when it's doing a thing, like say running? That's really all I am looking for. I don't know LUA enough but I assume I would need a function that calls math.random() to generate a random 'time' but I don't know how to code in a time exactly, the only function I know that uses time values is the DoTaskInTime one.

Link to comment
https://forums.kleientertainment.com/forums/topic/58396-how-to-use-mathrandom/
Share on other sites

math.random() return a value between (including) 0 and (excluding) 1. It can be supplied with integers (whole numbers) to generate a random integer between 0 and the argument, or between two arguments.

 

so THATS what that does. I see it everywhere and never really knew what it was for

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...