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
 

Define multiple items

Previous Thread :: Next Thread 
AdamHighDefinition is not online. AdamHighDefinition
Joined: 09 Aug 2015
Total Posts: 628
27 Aug 2015 08:08 PM
I'm not too sure how to word this..

How would I make this:

script.Parent.Frame.NA1.MouseButton1Click:connect(function()
-- script
end)

script.Parent.Frame.NA2.MouseButton1Click:connect(function()
-- script
end)

script.Parent.Frame.NA3.MouseButton1Click:connect(function()
-- script
end)

ect ect

How could I make this easier to navigate (There is going to be 50 in total so it would be loads of faff to do it like this.)
I'm stumped I'd need to be able to access the button that was clicked easily though.

Any ideas?
Report Abuse
Robotized is not online. Robotized
Joined: 14 Feb 2010
Total Posts: 167
27 Aug 2015 08:10 PM
local function NA1_mb1_click()
--allahu akbar
end

script.Parent.Frame.NA1.MouseButton1Click:connect(NA1_mb_click())
Report Abuse
solarDEV is not online. solarDEV
Joined: 23 May 2014
Total Posts: 1767
27 Aug 2015 08:11 PM
for _,v in pairs(script.Parent.Frame:GetChildren()) do
v.MouseButton1Click:connect(function()
--script
end)
end

assuming they all have the same functionality, otherwise you need to handle them each separately.
Report Abuse
AdamHighDefinition is not online. AdamHighDefinition
Joined: 09 Aug 2015
Total Posts: 628
27 Aug 2015 08:12 PM
@Above thanks, lifesaver :)
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