-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.lua
More file actions
61 lines (53 loc) · 1.69 KB
/
script.lua
File metadata and controls
61 lines (53 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
-- Auto generated script file --
local playerIsLimp = false
local EasyRagdoll = require("EasyRagdoll")
local RagdollTables = require("RagdollTables")
local ragdollKey = keybinds:newKeybind("Radgoll", "key.keyboard.1")
local function renderCall(a, delta, context)
local model = a:getModel()
local pos = model:partToWorldMatrix():apply()
local lightLevels = vec(
world.getBlockLightLevel(pos),
world.getSkyLightLevel(pos)
)
model:setLight(lightLevels)
end
ragdollKey.release = function()
playerIsLimp = false
models.model:setVisible(true)
EasyRagdoll.DestroyRD()
end
ragdollKey.press = function()
playerIsLimp = true
EasyRagdoll.SpawnRD(
RagdollTables.Rigidbodies,
RagdollTables.Joints,
renderCall
)
models.model:setVisible(false)
end
--hide vanilla model
vanilla_model.PLAYER:setVisible(false)
--hide vanilla armor model
vanilla_model.ARMOR:setVisible(false)
--re-enable the helmet item
vanilla_model.HELMET_ITEM:setVisible(true)
--hide vanilla cape model
vanilla_model.CAPE:setVisible(false)
--hide vanilla elytra model
vanilla_model.ELYTRA:setVisible(false)
--entity init event, used for when the avatar entity is loaded for the first time
function events.entity_init()
--player functions goes here
end
--tick event, called 20 times per second
function events.tick()
--code goes here
end
--render event, called every time your avatar is rendered
--it have two arguments, "delta" and "context"
--"delta" is the percentage between the last and the next tick (as a decimal value, 0.0 to 1.0)
--"context" is a string that tells from where this render event was called (the paperdoll, gui, player render, first person)
function events.render(delta, context)
--code goes here
end