Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i put functions in if statements?

For Example:

local cam = game.workspace.CurrentCamera
local FocusPart = game.Workspace.FocusPart

local function funct()
	wait(5)
cam.CameraType = "Fixed"

cam.Focus = FocusPart.CFrame
	print("Poo")
end

	
funct()

how would i put funct() into an if statements so i can do something like this:

local button = game.startergui.screengui.textbutton.
if _______ (etc) then
       button.visible = true
end

1 answer

if Function() then

Lol.

Your current function does not return anything, therefore your condition will be evaluated as falsly (it won't pass)

This discussion is preserved as it was. New answers, comments, and votes are closed.