Meowth552
|
  |
| Joined: 17 Dec 2009 |
| Total Posts: 2181 |
|
|
| 06 Nov 2016 01:06 PM |
local active = script.Parent.active.Value local cooldown = script.Parent.cooldown.Value
function onClicked(playerWhoClicked) local function Inner_Secondary_Sound_Play() for i,v in pairs(script.Parent.Parent:GetChildren()) do if v.Name == "Inner_Secondary_Sound" and active == false then active = true v.Sound:Play() script.Parent.BrickColor = BrickColor.new("Bright green") script.Parent.Sound:Play() cooldown = true wait(2) cooldown = false end end end
local function Inner_Secondary_Sound_Stop() for i,v in pairs(script.Parent.Parent:GetChildren()) do if v.Name == "Inner_Secondary_Sound" then active = false v.Sound:Stop() script.Parent.BrickColor = BrickColor.new("Bright red") script.Parent.Sound:Stop() cooldown = true wait(2) cooldown = false end end end
if active == false and cooldown == false then spawn(Inner_Secondary_Sound_Play()) elseif active == true and cooldown == false then spawn(Inner_Secondary_Sound_Stop()) end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Gives the error: Spawn requires 1 argument |
|
|
| Report Abuse |
|
|
| 06 Nov 2016 01:07 PM |
spawn(Inner_Secondary_Sound_Play) spawn(Inner_Secondary_Sound_Stop)
|
|
|
| Report Abuse |
|
Meowth552
|
  |
| Joined: 17 Dec 2009 |
| Total Posts: 2181 |
|
| |