Spanden Posted December 1, 2018 Share Posted December 1, 2018 I need smth like this: local oldSetPause=GLOBAL.SetPause function newSetPause() my_function() oldSetPause() end GLOBAL.SetPause=newSetPause but it doesn't work. Where is my mistake? Link to comment https://forums.kleientertainment.com/forums/topic/99877-rewrite-mainfunction/ Share on other sites More sharing options...
CarlZalph Posted December 1, 2018 Share Posted December 1, 2018 @Spanden You've left out function argument parameters. function newSetPause(...) + oldSetPause(...) If you want to know the arguments and to future proof it: function newSetPause(val, reason, ...) + oldSetPause(val, reason, ...) The three dots for an argument means in LUA: "There are any amount of additional arguments here, please handle all of them for me." It can only exist as the last argument in a function declaration. Link to comment https://forums.kleientertainment.com/forums/topic/99877-rewrite-mainfunction/#findComment-1125131 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