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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Efficiency

Previous Thread :: Next Thread 
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
03 Jul 2015 04:41 AM
So i have scripts that are around the lines of this

local Door = workspace.Door2
Door.ClickDetector.MouseClick:connect(function(click)
local moving = false
Door.lock:Play()
script.Parent.Text = "Locked..."
script.Parent.Visible = true
for i= 1,10 do
wait()
script.Parent.TextTransparency = 1-(i*0.1)
end
wait(1)
for i= 1,10 do
wait()
script.Parent.TextTransparency = (i*0.1)
end
end)
except its door3,door4,etc. I was wondering if i should use a module script instead of all those scripts, like

if The doors clickdetector is clicked then
require module
elseif
etc...

or should i do something else? (and if so how would i call only one of the functions?)

<3 cats <3
Report Abuse
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
03 Jul 2015 04:54 AM
er that was vague. i mean how to call a 1 function from the module


<3 cats <3
Report Abuse
bomblover is not online. bomblover
Joined: 23 Mar 2011
Total Posts: 238
03 Jul 2015 04:57 AM
1. I have no clue why you would do a for loop that way, but hey everyone has their own style.
and 2. You should probably just use a function and execute on each door, using a module would be really unnecessary.
Report Abuse
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
03 Jul 2015 05:00 AM
well im going to have ALOT of doors

<3 cats <3
Report Abuse
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
03 Jul 2015 05:00 AM
hahahahahahahahaahah lol bubba shut up... srry im tired


<3 cats <3
Report Abuse
bomblover is not online. bomblover
Joined: 23 Mar 2011
Total Posts: 238
03 Jul 2015 05:03 AM
Just group them all into a model and do this:
for i,Door in pairs(script.Parent:GetChildren()) do --// Put the script in the model
local Clicker = Door:FindFirstChild("Clicker") --// Clicker in the door part
if Clicker then
Clicker.MouseClick:connect(function()
--// Do whatever
end)
end
end
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