So I have a function that concatenates two values together, a parameter and a GUI's text. The problem is the script attempts to concatenate a nil value. For some reason I changed the GUI's text before calling the function and it still prints it.
I'm not sure why this happens, I don't think it's a bug though but more of the syntax?4
Here is a little snippet from the script:
--Timer() takes a number and concatenates it with a GUI's Text. local function Timer(formula) if formula == nil then TimerGui.Enabled = false else TimerGui.Enabled = true TimerText.Text = (TimerText.Text..formula) end end --Tool activation event: local function ToolMouseClick(Mouse) print("Tool clicked") if player.Team ~= game.Teams.Survivors and player.Character.Humanoid.Health ~= (0) then Tool:Destroy() return end Timer.Text = ("Flashbang detonating in: ") Timer(1) end
Thanks for viewing this!