Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make it so the game plays a sound when the player clicks while an item is being held?

Just for some context: "GameToy" is the tool that should be equipped when the player clicks, and plays the sound. And "sound" is the sound that's supposed to play. And "Backup" is the sound that was meant to play, and backup is the folder in the workspace that has the tool.

Here was my previous attempt:

local tool = Workspace.Backup.GameToy
local sound = game.workspace.backup.GameToy.Sound
tool.Activated:Connect():Button2Down():Connect(function()
  game.Workspace.Backup.GameToy.Sound:Play()
end)

1 answer

You're on the right track, but you're still wrong.

So first, make a local script inside the tool.

and then use tool.Activated for that. an example would be :

local tool = script.Parent
local sound = workspace.Sound

tool.Activated:Connect(function()
sound:Play()
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.