wiki.sine.space | sinespace

Difference between revisions of "Scripting/SGames"

From wiki.sine.space
Jump to: navigation, search
(Created page with "=Properties= {{ScriptFunction|void|StartActivity|(int activityID)|Start an activity with its id.|5= Space.Activity.StartActivity(99956)<br> ''--If the activity exists, it wil...")
 
Line 15: Line 15:
 
}}
 
}}
  
{{ScriptFunction|void|FinishActivity|(int activityId, float score, int xp = 0, Closure results = null)|Start an activity with its id.|5=
+
{{ScriptFunction|void|FinishActivity|(int activityId, float score, int xp = 0)|Start an activity with its id.|5=
 
Space.Activity.FinishActivity(99956,100,0,function (rank)<br>
 
Space.Activity.FinishActivity(99956,100,0,function (rank)<br>
 
&nbsp;&nbsp;&nbsp;&nbsp;Space.Log(rank.Level)<br>
 
&nbsp;&nbsp;&nbsp;&nbsp;Space.Log(rank.Level)<br>

Revision as of 05:31, 4 January 2021

Properties

StartActivity

void StartActivity (int activityID)

Start an activity with its id.

Space.Activity.StartActivity(99956)
--If the activity exists, it will start.


RequestLeaderboard

void RequestLeaderboard (int activityID, Closure results)

Get the leader board of an activity.

Space.Activity.RequestLeaderboard(99956,function (res)

    for i=1,#res do
Space.Log(res[i].Rank.." Score "..res[i].Score.." Username "..res[i].Username)
    end
end)

--If the activity exists, it will display Score info.


FinishActivity

void FinishActivity Start an activity with its id.

No documentation

Space.Activity.FinishActivity(99956,100,0,function (rank)

    Space.Log(rank.Level)
end)

--If the activity exists, it will display ScoreRank info.