From d43f38db88a7a93c47ffac316fa4684c638e2819 Mon Sep 17 00:00:00 2001 From: Nathan Falvey Date: Sat, 17 Jan 2026 21:45:07 +0000 Subject: [PATCH] Add random_choice helper function to effect template --- effect_template.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/effect_template.lua b/effect_template.lua index db4a131..8669169 100644 --- a/effect_template.lua +++ b/effect_template.lua @@ -35,3 +35,14 @@ function OnTick() end -- Add custom helper functions below. + +function random_choice(p1) + if type(p1) ~= "table" or #p1 == 0 then + return nil + end + local choice = p1[math.random(#p1)] + return choice +end + + +