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 https://forums.kleientertainment.com/forums/topic/47585-codeing-loop-help/ 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 https://forums.kleientertainment.com/forums/topic/47585-codeing-loop-help/#findComment-592902 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 https://forums.kleientertainment.com/forums/topic/47585-codeing-loop-help/#findComment-592919 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now