Whix Posted December 26, 2014 Share Posted December 26, 2014 Hello i'm trying to add the following into a loopinst:ListenForEvent("rainstart", function() end, GetWorld()) I am not sure if i am going about this correctly but basically what i want is to for example, while rain is on such and such happens to this character else something else happens. Not sure on how to do it, i have tried a couple of ways, but i am not even sure if i should be using an if statement instead of a while one. (Also i am putting the line of code into the "local fn = function(inst)" of my characters script). But in the end i want it to constantly be checking for if there is rain and if so do whatever i specify it to do (i have had it done before without the loop but since it wasn't a loop it didn't reset itself) Link to comment Share on other sites More sharing options...
Whix Posted December 26, 2014 Author Share Posted December 26, 2014 Never mind, i have an alternative that works better than that would ever work. Link to comment Share on other sites More sharing options...
Mobbstar Posted December 26, 2014 Share Posted December 26, 2014 ListenForEvent creates a new listener, which means you'd eat up lots of memory over time, especially if its a while loop... (generally, don't use those in DS, they freeze the game) Glad you found a work-around! =D Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.