Sign In Register

How can we help you today?

Start a new topic
Answered

Global Scripts

Hello, it is possible to have a single place, where i can write some functions which then i can use from different scripts?

Since now for example, when user win or lost the challenge, (ChallengeWonMessage/ChallengeLostMessage) i'm updating my leaderboards depending on win/loose. 

I've write the same code for update the leaderboard for both challengeLostMessage script and challengeWonMessage script. It's better for me to call my custom function, say UpdateLeaderboard(Name, value); which is visible from both scripts. 

Some help will be handful here. 


Best Answer

Hi,


Yes a module would suit your needs here. The documentation on modules can be found here. Have a read through that and if you require any further assistance just let us know.


Regards,

Liam


Answer

Hi,


Yes a module would suit your needs here. The documentation on modules can be found here. Have a read through that and if you require any further assistance just let us know.


Regards,

Liam

Found, modules. Unfortunately, lack of documentations for this feature.

Create common functions in modules.

(see modules section here: https://docs.gamesparks.com/documentation/configurator/cloud-code.html)

Login to post a comment