I'm doing a script for when I give a punch the player damage the dummy and cause a different sound, but this script only works with just a dummy, the other 3 are not suffering any change out, what should I do?
Sorry with my English
The Script :
for i,v in pairs(game.Workspace:GetChildren()) do
if v:FindFirstChild("Humanoid") and v ~= script.Creator.Value and v:findFirstChild("Torso") then
if (v.Torso.Position - script.Parent.Position).magnitude <= 5 then
v.Humanoid:TakeDamage(script.Damage.Value)
local Sound = Instance.new("Sound", script.Parent)
Sound.SoundId = "http://www.roblox.com/asset/?id=131237241"
Sound.Volume = 0.3
Sound.Pitch = 1
Sound:Play()
wait(1)
Sound:Destroy()
else
local Sound = Instance.new("Sound", script.Parent)
Sound.SoundId = "http://www.roblox.com/asset/?id=508243106"
Sound.Volume = 0.2
Sound.Pitch = 1
Sound:Play()
wait(1)
Sound:Destroy()
end
end
end
