From 3c21c6c5814191f3ad0873a65840208c93274a89 Mon Sep 17 00:00:00 2001 From: NullBite Date: Wed, 23 Mar 2022 21:31:27 -0400 Subject: [PATCH] Add math function for animation --- script.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/script.lua b/script.lua index 07e83ce..0d7cd7f 100644 --- a/script.lua +++ b/script.lua @@ -201,6 +201,14 @@ function recurseModelGroup(group) end -- }}} +-- Math {{{ +--- Sine function with period and amplitude +--- @param x number Input value +--- @param period number Period of sine wave +--- @param amp number Peak amplitude of sine wave +function wave(x, period, amp) return math.sin((2/period)*math.pi*(x%period))*amp end +-- }}} + -- master state variables and configuration (do not access within pings) -- {{{ if client.isHost() then local defaults={