Line 47: | Line 47: | ||
− | {{ScriptFunction|float|GetHeight|();|Return height of avatar.|5=<pre></pre>|6=<pre></pre>}} | + | {{ScriptFunction|float|GetHeight|();|Return height of avatar.|5=<pre>height = Space.Host.ExecutingObject.AvatarAppearance.GetHeight()</pre>|6=<pre>--this script updates a UIText with the height of this NPC statue |
+ | |||
+ | thisObject = Space.Host.ExecutingObject | ||
+ | uiText = Space.Host.GetReference("thetext").UIText --Add this object with UIText component as reference in Scripting Runtime | ||
+ | |||
+ | OnUpdateFunction = function() | ||
+ | height = Space.Host.ExecutingObject.AvatarAppearance.GetHeight() | ||
+ | uiText.Text = height | ||
+ | end | ||
+ | |||
+ | |||
+ | thisObject.OnUpdate(OnUpdateFunction)</pre>}} | ||
Changes the current Avatar's outfit to outfitID. For a player Avatar, this only works on white-label grid. For NPC avatars, this works on all grids.
Space.Host.ExecutingObject.AvatarAppearance.LoadOutfit(160)
--this script toggles between 3 different outfits when NPC Statue object is clicked --[Object needs to have an NPC Statue component] outfits = {4134388, 4134385, 4134386} currentOutfit = 0 thisObject = Space.Host.ExecutingObject function OnClickFunction() if currentOutfit == #outfits then currentOutfit = 1 else currentOutfit = currentOutfit + 1 end thisObject.AvatarAppearance.LoadOutfit(outfits[currentOutfit]) end thisObject.AddClickable() thisObject.Clickable.OnClick(OnClickFunction)
Changes the current Avatar's outfit and resets it to outfitID 0. For a player Avatar, this only works on white-label grid. For NPC avatars, this works on all grids.
Space.Host.ExecutingObject.AvatarAppearance.ResetOutfit()
--this script makes a UIButton reset an NPC statue outfit when clicked --[UIButton object needs to be linked in scripting runtime references with name "button1"] --[Object needs to have an NPC Statue component] thisObject = Space.Host.ExecutingObject refButton = Space.Host.GetReference("button1") function OnClickFunction() thisObject.AvatarAppearance.ResetOutfit() end refButton.UIButton.OnClick(OnClickFunction)
For a player Avatar, this only works on white-label grid. For NPC avatars, this works on all grids.
Return the value of Appearance Sliders.
Return height of avatar.
height = Space.Host.ExecutingObject.AvatarAppearance.GetHeight()
--this script updates a UIText with the height of this NPC statue thisObject = Space.Host.ExecutingObject uiText = Space.Host.GetReference("thetext").UIText --Add this object with UIText component as reference in Scripting Runtime OnUpdateFunction = function() height = Space.Host.ExecutingObject.AvatarAppearance.GetHeight() uiText.Text = height end thisObject.OnUpdate(OnUpdateFunction)
Return skin tone of avatar.
Return eye tone of avatar.
Return the current outfit id.
Return the GameObject of avatar skeleton.
Returns true if the avatar is full loaded.
|