Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Why doesnt it work?

Asked by 8 years ago
function Equip(parent,pitch,volume,remove_time)
local EquipSound = Instance.new("Sound",parent)
game.Debris:AddItem(EquipSound,remove_time)
EquipSound.SoundId = "http://www.roblox.com/asset/?id=153647514"
game:GetService("ContentProvider"):Preload(EquipSound.SoundId)
EquipSound.Pitch = pitch
EquipSound.Volume = volume
EquipSound:Play()
return (EquipSound)
end

function GiveMask()
Equip()
end

script.Parent.Button.MouseButton1Click:connect(function()
GiveMask()

end)

0
output 1waffle1 2908 — 8y

1 answer

Log in to vote
1
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
8 years ago

You're calling Equip without passing any arguments. It has four parameters that you haven't given any values to. pitch and volume are the ones that will make it error if it doesn't get them.

Ad

Answer this question