PlayOnRemove (Property): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Mindraker
>Anaminus
No edit summary
Line 1: Line 1:
== PlayonRemove ==
{{Property|
 
name                = PlayOnRemove
It is very simple to stop music you get from playing.
|property            = [[Bool]] ''PlayOnRemove''
 
|description          = Sets whether the object should be played when it is removed or not.
#Click tools
|object              = [[RBX.Lua.Sound (Object)|Sound]]
#click the "+" next to workspace
|}}
#scroll down
#Select the music or sound
#look at the properties
#fill in the check next to "Play on remove"
 
'''If you dont have workspace or properties'''
 
#Click tools
#Click the view button ontop
#look for properties and workspace
#Click them.
 
'''The script'''
 
<pre>
local s = Instance.new("Sound")
 
s.Name = "Sound"
s.SoundId = "e51fef40bfd5bb1327e46dc65715aa6e"
s.Volume = 1
s.Looped = true --See where it says looped? change true to false
s.archivable = false
 
s.Parent = game.Workspace
 
wait(0)
 
s:play()
 
</pre>
 
'''Changing the script'''
It says true after the "=" next to looped, change the word "true" to "false"
for it to remove so it only plays once.
 
[[Category:Scripting Tutorials]]

Revision as of 20:16, 6 August 2008

PlayOnRemove
Property Bool PlayOnRemove
Description Sets whether the object should be played when it is removed or not.
Member of [[RBX.lua.Sound (Object)|Sound]]