How would I make a function take in a true or false value?

I have been trying to think of how to go about this but just can’t seem to think of how to do it, It’s probably very simple

Here’s what I mean.

local function example(value)
	-- do some stuff according to what value was passed
end

example(true)
local function example(value)
    if value == true then
        --do stuff

    elseif value == false then
        -- do stuff
    
    else
        print("passed value wasn't a boolean")
    end
end

example(true)

is probably the easiest approach.

1 Like

Wow yeah it’s a lot easier then I thought, Thank you!