Clarify what value a variable contains (like parameters in functions)

What I mean with functions:

function module.new(Parameter: boolean)
       -- This 'Parameter' is now recognized as a booleon
end

What I want to achive:
I want the same thing but for variables

local Number = 1 --Here I want to declare what the variable value type is

Is this possible in roblox or not? It’s something that most game engines I’ve used have

1 Like

Here:
local variable: datatype = value respective to datatype

Example:
local Number: number = 1

Remember that Lua is dynamically typed

Thanks! I tried putting the double colon behind the value!

Did you mean this?
local Number = 0:: number ?

Because that’s for the value not for the variable.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.