|
| 28 Aug 2016 07:02 PM |
Frame -LocalScript -Spawn (TextButton) -Rules (TextButton) -FAQ (TextButton) -TOS (TextButton)
In the localscript, I want to write a function that highlights the Gui through mouseover. Seeing as I'm lazy, I don't want to clone a localscript through each button, so all of the functions are localized into the script.
local core = script.Parent local spawner,rules,tos,faq,banner = core.Spawn, core.Rules, core.TOS, core.FAQ, core.Banner local player = game.Players.LocalPlayer local boolean = script.InUse.Value
function enter(button) button.BackgroundTransparency = Color3.fromRGB(200,200,200) end
function leave(button) button.BackgroundTransparency = Color3.fromRGB(255,255,255) end
spawner.MouseEnter:connect(enter(spawner)) spawner.MouseLeave:connect(leave(spawner))
Error is "Attempt to connect failed: passed value is not a function".
Probably using function arguments wrong, but please let me know. |
|
|
| Report Abuse |
|
|
| 28 Aug 2016 07:14 PM |
| Don't make me code individual functions for each button. |
|
|
| Report Abuse |
|
|
| 28 Aug 2016 07:18 PM |
you have to do function() enter(spawner) end)
because you have to give it a function |
|
|
| Report Abuse |
|
| |
|
| 28 Aug 2016 07:45 PM |
no
youre calling the function
so what you are giving it is what that function returns
-.- |
|
|
| Report Abuse |
|
|
| 28 Aug 2016 07:48 PM |
Ah, I see what you meant.
Sorry. Thanks. |
|
|
| Report Abuse |
|