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: Spawn() script error

Previous Thread :: Next Thread 
Meowth552 is not online. 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
newcoolman2 is not online. newcoolman2
Joined: 01 Apr 2010
Total Posts: 2637
06 Nov 2016 01:07 PM
spawn(Inner_Secondary_Sound_Play)
spawn(Inner_Secondary_Sound_Stop)


Report Abuse
Meowth552 is not online. Meowth552
Joined: 17 Dec 2009
Total Posts: 2181
06 Nov 2016 01:30 PM
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