Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i put functions in if statements?

Asked by 1 year ago

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

Log in to vote
0
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
1 year ago
if Function() then

Lol.

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

Ad

Answer this question