From 7b51269f8b371588f9b8444fa3f17c3232744b6a Mon Sep 17 00:00:00 2001 From: NullBite Date: Mon, 28 Mar 2022 22:03:19 -0400 Subject: [PATCH] Add model switcher Requires https://github.com/dragekk/figura_avatar_api --- script.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/script.lua b/script.lua index 1525aab..b8c670c 100644 --- a/script.lua +++ b/script.lua @@ -201,6 +201,32 @@ function recurseModelGroup(group) end -- }}} +-- Model switcher (credit to dragekk#7300) {{{ +function switch_model(path) + if avatar then + if not avatar.isLocal() then + local name = data.getName() + data.setName("avatar_switch") + data.save("upload", "yes") + data.setName(name) + end + avatar.set(path) + end +end +if avatar then + local name = data.getName() + data.setName("avatar_switch") + local loaded = data.load("upload") + if loaded == "yes" then + data.save("upload", "no") + data.setName(name) + avatar.uploadToBackend() + else + data.setName(name) + end +end +-- }}} + -- Timer (not mine lol) -- {{{ do local timers = {} @@ -778,6 +804,9 @@ action_wheel.SLOT_4.setTitle('T-Pose') action_wheel.SLOT_4.setFunction(function() ping.tPose() end) action_wheel.SLOT_5.setTitle('UwU') action_wheel.SLOT_5.setFunction(function() ping.expr("owo") end) +action_wheel.SLOT_8.setTitle('sssss...') +action_wheel.SLOT_8.setItem("minecraft:creeper_head") +action_wheel.SLOT_8.setFunction(function() switch_model('misc/Creeper') end) -- Pings -- --- Damage function --