|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 03 Jul 2015 05:00 AM |
well im going to have ALOT of doors
<3 cats <3 |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2015 05:00 AM |
hahahahahahahahaahah lol bubba shut up... srry im tired
<3 cats <3 |
|
|
| Report Abuse |
|
|
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 |
|
|