Talk:Sounds: Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Mindraker Tested |
>Mindraker mNo edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Testing == | == Testing == | ||
OK, this has been tested because this is the code I just worked with on the [[Music|music]] page. {{User:Mindraker/sig}} 19:12, 19 August 2008 (CDT) | OK, this has been tested because this is pretty much the code I just worked with on the [[Music|music]] page. | ||
<pre> | |||
debounce = false | |||
function onTouched(hit) | |||
if debounce == false then | |||
debounce = true | |||
local s = Instance.new("Sound") | |||
s.Name = "Sound" | |||
s.SoundId = "yourSoundIdGoesHere" -- SoundId! Type here yours. | |||
s.Volume = 1 | |||
s.Looped = false | |||
s.archivable = false | |||
s.Parent = game.Workspace | |||
wait(0) | |||
s:play() | |||
end | |||
end | |||
script.Parent.Touched:connect(onTouched) | |||
</pre> {{User:Mindraker/sig}} 19:12, 19 August 2008 (CDT) |
Latest revision as of 00:23, 20 August 2008
Testing
OK, this has been tested because this is pretty much the code I just worked with on the music page.
debounce = false function onTouched(hit) if debounce == false then debounce = true local s = Instance.new("Sound") s.Name = "Sound" s.SoundId = "yourSoundIdGoesHere" -- SoundId! Type here yours. s.Volume = 1 s.Looped = false s.archivable = false s.Parent = game.Workspace wait(0) s:play() end end script.Parent.Touched:connect(onTouched)