K
Is it really easier to create and post screenshots than copy and paste text in CODE blocks?Hi, I'm new to GMS2 and I am using the trial version now. This is the error I receive:
View attachment 23391
This is the script:
View attachment 23393
This is the button:
create event:
View attachment 23394
left_pressed event:
View attachment 23395
step event:
View attachment 23396
Please help me out guys. It is driving me crazy.
answer = script_execute(scr_aplusb(), num1, num2);
answer = script_execute(scr_aplusb, num1, num2);
Omg, I never know it could work like this. I mean it is very obvious and straight forward but I only follow the documentation:Code:answer = scr_aplusb(num1, num2);
Not a problem. You do know that in this particular case that you show code for @Dmi7ry's code would work just fine, right? I just assumed your end goal was more complex than just doing the equivalent of a function call.Hi, chamaeleon. Omg, you saved me. Sorry about the screenshots.
So I followed your advise, I'm sure you have tested it or so:
toCode:answer = script_execute(scr_aplusb(), num1, num2);
It worked. Thank you so much, chamaeleon.Code:answer = script_execute(scr_aplusb, num1, num2);
I just want to call and pass argument to the said script.Not a problem. You do know that in this particular case that you show code for @Dmi7ry's code would work just fine, right? I just assumed your end goal was more complex than just doing the equivalent of a function call.
Then just do it without using script_execute just like as if your script was a builtin function.I just want to call and pass argument to the said script.