generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Lazy Gui scripting

Previous Thread :: Next Thread 
NewbControl114 is not online. NewbControl114
Joined: 09 May 2009
Total Posts: 10303
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
NewbControl114 is not online. NewbControl114
Joined: 09 May 2009
Total Posts: 10303
28 Aug 2016 07:14 PM
Don't make me code individual functions for each button.
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
28 Aug 2016 07:18 PM
you have to do function()
enter(spawner)
end)

because you have to give it a function
Report Abuse
NewbControl114 is not online. NewbControl114
Joined: 09 May 2009
Total Posts: 10303
28 Aug 2016 07:38 PM
It has a function?
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
28 Aug 2016 07:45 PM
no

youre calling the function

so what you are giving it is what that function returns

-.-
Report Abuse
NewbControl114 is not online. NewbControl114
Joined: 09 May 2009
Total Posts: 10303
28 Aug 2016 07:48 PM
Ah, I see what you meant.

Sorry. Thanks.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image