init
This commit is contained in:
commit
b7656b5249
15 changed files with 1713 additions and 0 deletions
22
scripts/nameplate.lua
Normal file
22
scripts/nameplate.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
local name = "reidlab!"
|
||||
local colors = { "#d87b5a", "#e0ab91" }
|
||||
local offset = 0.05
|
||||
local speed = 0.05
|
||||
|
||||
colors[#colors + 1] = colors[1]
|
||||
offset = offset / speed
|
||||
|
||||
function events.tick()
|
||||
local newName = "["
|
||||
|
||||
for i = 1, #name, 1 do
|
||||
local counter = (((world.getTime() + offset * i) * speed) % (#colors - 1)) + 1
|
||||
local counterFloored = math.floor(counter)
|
||||
local color = math.lerp(vectors.hexToRGB(colors[counterFloored]), vectors.hexToRGB(colors[counterFloored + 1]), counter - counterFloored)
|
||||
newName = newName .. '{"text":"' .. name:sub(i,i) .. '","color":"#' .. vectors.rgbToHex(color) .. '"},'
|
||||
avatar:setColor(color)
|
||||
end
|
||||
|
||||
newName = newName:sub(1, #newName - 1) .. "]"
|
||||
nameplate.ALL:setText(newName)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue