What does the parameter in callbacks do?

I want to make a gui for a “Kill all players for 3 minutes” and have a countdown in the script. The more you buy it, it always adds 3 minutes/180 seconds. I used cloning guis into player guis to add the gui, but everytime the product is bought, it clones ANOTHER gui. So what I did was add an if statement where if a clone already exists, it callsback to a function, and same thing for the else part.

I want to make it return what the textLabel is.(If it clones a gui, it makes a textLabel and makes a textLabel variable for that, and if there already was a clone, it just makes the already existing clone’s textLabel as the textLabel variable.)

So my question is, can I use the parameter/parantheses to give the variable?
For example,

local function textLabelGui(textLabel)
	sGdgSDDSfDF
	zdhgdfgxdzg
end

if clone then
	local textLabel = clone.TextLabel
	textLabelGui(textLabel)--------------I want to know if I can return textLabel to the function above
elseif not clone then
	local guiClone = gui:Clone()
	guiClone.Name "guiClone"
	guiClone.Parent = player.PlayerGui
	local textLabel = guiClone.TextLabel
	textLabelGui(textLabel)--------------I want to know if I can return textLabel to the function above
end
1 Like

yes you can use that to give the variable

Oh, okay then. Thanks a lot!!!

1 Like

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