|
| 10 Nov 2013 02:30 PM |
| I want to play radioactive when somone passes through a certain block cause I have a skydiving game and it would make it epic, I have the chat voice thing (Don't know if this is in right forum or what ever) |
|
|
| Report Abuse |
|
|
XAXA
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 6315 |
|
|
| 10 Nov 2013 02:32 PM |
script.Parent.Touched:connect(function() --Play music end)
http://wiki.roblox.com/index.php/Touched_(Event) |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2013 03:22 PM |
| What do you mean "Play music"? Do you mean put the id of the music? Cause that's all I have. |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2013 03:24 PM |
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local s = Instance.new("Sound",hit.Parent.Head) s.SoundId = ? s:Play() end end) |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2013 04:50 PM |
| Do I have to put audio in the soundscape or in lighting or something? I tried it the script but it didn't work |
|
|
| Report Abuse |
|
|
domorox17
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 1710 |
|
|
| 10 Nov 2013 04:55 PM |
| make sure us have the asset url, not iust the id. its something like roblox.com/asset/(randomsymobls)id= |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2013 05:00 PM |
Find the ID of the sound, and replace the 0 in "local id = 0;" with your ID.
local id = 0; local debounce = false;
script.Parent.Touched:connect(function(hit) if debounce then return end if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then debounce = true; local s = Instance.new("Sound", script.Parent); s.SoundId = id; s.PlayOnRemove = true; s:Destroy(); wait(1); debounce = false; end end)
I added in a debounce so the sound wouldn't be spammed by just touching the brick. You should set the wait-time to the length of the sound if you don't want the sound to play when it already is playing. |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2013 05:05 PM |
@Above i think u need a "http://www.roblox.com/asset/?id="
♫♪ repeat wait() until game.Players.FrozenSmite.HasALife == true ♪♫ |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2013 05:06 PM |
OH snap! I wrote the first line before I started the script, just assumed I would remember it.
Correct, the "local id = 0;" should be "local id = http://www.roblox.com/asset/?id=0"; |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2013 05:11 PM |
| That creates an error for me? |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2013 05:14 PM |
What is the error? And what was the final script?
It should look like this:
local id = "http://www.roblox.com/?id=0"; local debounce = false;
script.Parent.Touched:connect(function(hit) if debounce then return end if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then debounce = true; local s = Instance.new("Sound", script.Parent); s.SoundId = id; s.PlayOnRemove = true; s:Destroy(); wait(1); debounce = false; end end)
|
|
|
| Report Abuse |
|
|
|
| 10 Nov 2013 05:34 PM |
Final script is,
local id = "http://www.roblox.com/?id=131111368"; local debounce = false;
script.Parent.Touched:connect(function(hit) if debounce then return end if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then debounce = true; local s = Instance.new("Sound", script.Parent); s.SoundId = id; s.PlayOnRemove = true; s:Destroy(); wait(1); debounce = false; end end)
|
|
|
| Report Abuse |
|
|
|
| 10 Nov 2013 05:46 PM |
| woopsie forgot /asset/ in the url I put that in script just didnt write it in forum. |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2013 06:19 PM |
Try this, then:
local id = "http://www.roblox.com/asset/?id=131111368"; local debounce = false;
script.Parent.Touched:connect(function(hit) if debounce then return end if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then debounce = true; local s = Instance.new("Sound", script.Parent); s.SoundId = id; s:Play(); wait(1); debounce = false; end end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Nov 2013 06:25 PM |
| Nvm It did work but how do i make it louder? |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2013 06:33 PM |
| AND it only works in test thing in studio. :( |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Nov 2013 09:11 PM |
Omg, do anyone of you guys know anything about :Play()???
script.Parent.Touched:connect(function(part) local h = part.Parent:findFirstChild("Humanoid") if h ~= nil then script.Music:Play() end end) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 10 Nov 2013 09:11 PM |
Yes, it plays a sound But I don't know if sounds play in scripts |
|
|
| Report Abuse |
|
|
| |
|