function pie(num1, num2)
end
chicken = pie(0.4,0.5)
script.Parent.Transparency = chicken
function pie(num1, num2)
end
chicken = pie(0.4,0.5)
script.Parent.Transparency = chicken
I have no idea what pie() is supposed to do but I'm just gonna assume it adds 2 numbers together.
To do that, we can do:
local function pie(num1, num2)
local x = num1 + num2
return x -- returning means whenever the function is called, it is basically "replaced" in the statement with whatever value x has
end
chicken = pie(0.4,0.5) -- so pie(0.4,0.5) here becomes 0.9 because x in the function is 0.4 + 0.5 = 0.9
script.Parent.Transparency = chicken
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
why do you have two argument?also that function is n't doing anything you would have to return the value
i thought having two arugments is alright for a script how to i also return it properly? im trying to get into scripting but the function argument things are confusing me