View Single Post
  #11  
Old 05-06-2011, 09:29 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by cbk1994 View Post
Not sure what you're asking.
For instance, I guess function onPlayerGrabs(){ }
could be made a class that could return true and make the if statement work..

if (onPlayerGrabs()){} "I think could work assuming it is joined to the class"
could return true or false.. I don't know how it works really...

Quote:
Originally Posted by cbk1994 View Post
You can only return one value. Use arrays for returning multiple.
Oh I see.. thanks ^.^;
In the future could they do it with commas to add more, or is there no point?


Quote:
Originally Posted by cbk1994 View Post
Functions return values, not variables. You can assign them to whatever variable you want to.
I've had a function go through all players, and didn't accept externals.
I had it as:
variable
temp.count = 0;

a lot of script...

return temp.count
and
return count

which kept becoming 0 or null... in the end I set it to this.count = temp.count and it finally worked with:

return this.count

I couldn't get it to pass the temp. variable D:
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote