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

Radio Not Playing Upon Equipped?

Asked by 7 years ago

I've got a script here I'm using to make a radio play music when equipped and to make the music pause when it is not equipped.

local Sound = script.parent.radio


function Equip()
    Sound:play()
end

function Unequip()
    Sound:pause()
end

it does not seem to work. tips?

0
is this the full script? User#5423 17 — 7y
0
yes, it is the full script. i'm quite new so i'm unsure how to do this kind of thing. most of my scripts are very simple. aquadrious 53 — 7y

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
7 years ago
Edited 7 years ago

Capitalization is important.

  1. Its script.Parent
  2. You have to bind your Equip function
  3. You have to bind your Unequip function
  4. Its Sound:Play()
  5. Its Sound:Pause()

To bind your functions, use Tool.Equipped:Connect(Equip) and Tool.Unequipped:Connect(Unequip)

Ad

Answer this question