|
| 04 Oct 2015 06:59 PM |
im trying to play this sound http://www.roblox.com/Sad-Violin-item?id=147080452 with the follwoing script:
function onTouched(hit) local humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid ~= nil then ogm = humanoid.Parent.Head blow = Instance.new("Explosion", ogm) blow.Position = ogm.Position blow.BlastRadius = 0 blow.BlastPressure = 0 wait (1) sond = Instance.new("Sound", humanoid.Parent.Torso) sond.SoundId = 147080452 tagHumanoid(humanoid) humanoid:TakeDamage(damage) untagHumanoid(humanoid) end
HitSound:Play() sond:Play() ball.Parent = nil
end
but i keep getting this error
19:59:30.015 - Sound failed to load : Workspace.AhhTree.Torso.Sound
BEEP BEEP HERE COMES THE MEME CREEP |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2015 07:02 PM |
| failed to explain what part you are going to touch |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2015 07:03 PM |
it doesnt matter what part your gonna hit it matters if the parent has a humanoid in it
BEEP BEEP HERE COMES THE MEME CREEP |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2015 07:04 PM |
Add script.(what the brick is that the humanoid is going to touch):connect onTouch()
Send me trades! Looking to downgrade and upgrade! |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2015 07:07 PM |
heres the entire script
ball = script.Parent damage = 10
HitSound = Instance.new("Sound") HitSound.Name = "HitSound" HitSound.SoundId = "http://www.roblox.com/asset/?id=11945266" HitSound.Parent = ball HitSound.Volume = 1
function onTouched(hit) local humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid ~= nil then ogm = humanoid.Parent.Head blow = Instance.new("Explosion", ogm) blow.Position = ogm.Position blow.BlastRadius = 0 blow.BlastPressure = 0 wait (1) sond = Instance.new("Sound", humanoid.Parent.Torso) sond.SoundId = 147080452 tagHumanoid(humanoid) humanoid:TakeDamage(damage) untagHumanoid(humanoid) end
HitSound:Play() sond:Play() ball.Parent = nil
end
function tagHumanoid(humanoid) -- todo: make tag expire local tag = ball:findFirstChild("creator") if tag ~= nil then local new_tag = tag:clone() new_tag.Parent = humanoid end end
function untagHumanoid(humanoid) if humanoid ~= nil then local tag = humanoid:findFirstChild("creator") if tag ~= nil then tag.Parent = nil end end end
connection = ball.Touched:connect(onTouched)
wait(5) --ball.SparkSound.Looped = false --ball.SparkSound:Stop() ball.Parent = nil
BEEP BEEP HERE COMES THE MEME CREEP |
|
|
| Report Abuse |
|
|