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: Touched Event Disabling

Previous Thread :: Next Thread 
spider10111 is not online. spider10111
Joined: 02 Nov 2012
Total Posts: 865
14 May 2016 10:42 PM
So i made a trap thing, where when you touch a wire, everything happens, but when i make an audio play, when you step on it, it will keep playing the audio over and over again on top of each other.

How do i stop this? This is my script.

function triggered()
script.Parent.Green.Transparency = 1
script.Parent.Red.Transparency = 0

local s = Instance.new("Sound")

s.Name = "BGMusic"
s.SoundId = "http://www.roblox.com/asset/?id=188908311"
s.Volume = 1
s.Looped = true
s.archivable = false

s.Parent = game.Workspace

wait(1)

s:play()


end

script.Parent.String.Touched:connect(triggered)


Report Abuse
DarthStrantax is not online. DarthStrantax
Joined: 31 May 2011
Total Posts: 2610
14 May 2016 10:46 PM
function triggered()
if playing then return end
playing=true
script.Parent.Green.Transparency = 1
script.Parent.Red.Transparency = 0

local s = Instance.new("Sound")

s.Name = "BGMusic"
s.SoundId = "http://www.roblox.com/asset/?id=188908311"
s.Volume = 1
s.Looped = true
s.archivable = false

s.Parent = game.Workspace

wait(1)

s:play()
end

script.Parent.String.Touched:connect(triggered)
Report Abuse
GGGGG14_x2 is not online. GGGGG14_x2
Joined: 12 May 2016
Total Posts: 10
14 May 2016 11:42 PM
http://wiki.roblox.com/index.php?title=API:Class/Sound/Looped

You set looped as a true value for the sound...
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