Marcousik Posted May 28, 2019 Share Posted May 28, 2019 I found this function in the FPSPlayer.lua --Increase health function Script:ReceiveHealth(healthPoints)--in --Increase health self.health = self.health + healthPoints; --Health can not be more then maximum health if self.health > self.maxHealth then self.health = self.maxHealth end --Call Health received output self.component:CallOutputs("HealthReceived") end I can call this function through the flowgraph using the output Function (example calling the function self:Heal(10) ) of another script but it returns an error about the argument "healthPoints" as nil value, whatever I give as argument. function Script:Heal(healthPoints)--out self.component:CallOutputs("Healing") end What am I doing wrong ? thx for help Quote Link to comment Share on other sites More sharing options...
Solution Rick Posted May 28, 2019 Solution Share Posted May 28, 2019 Notice how the function has --in at the end. That tell the editor it can be called. When --in functions exist with parameters you need a function that has --args and returns a value (I believe is the name) and then that'll show up and you can drag that function to the dot that should show up in the flowgraph on the line of the ReceiveHealth() function. So dots show up on that line and they act as argument placeholders (1 for each argument). When you drag a --args function to that line, that function will be called and the returning value will act as the argument value. 1 Quote Link to comment Share on other sites More sharing options...
Marcousik Posted May 30, 2019 Author Share Posted May 30, 2019 THX Rick. A tutorial on this may be a very cool thing Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.