local tool = script.Parent local sound = game.workspace.backup.GameToy.Sound tool.Activated:Connect(function() game.Workspace.Backup.GameToy.Sound:Play() end)
Here's what I have so far. Here's some context in case you're confused: GameToy is the tool I want to play a sound. "Backup" is a folder in the workplace where I keep the Gametoy.
So If You Want It To Do It For The Client Only Then Do This:
local tool = script.Parent -- Put The Local Script Inside The Tool local songid = 0 -- The Numbers In The Song tool.Activated:Connect(function() local sound = Instance.new("Sound") sound.Parent = tool sound.SoundId = "rbxassetid://"..songid sound:Play() wait(sound.TimeLength) sound:remove() end)
If You Want it To Play On The Server Side Its A Bit Harder
local tool = script.Parent -- Put The Local Script Inside The Tool local songid = 0 -- The Numbers In The Song tool.Activated:Connect(function() game.ReplicatedStorage.SoundServer:FireServer(songid) end)
game.ReplicatedStorage.SoundServer.OnServerEvent:Connect(function(player,songid) local sound = Instance.new("Sound") sound.Parent = workspace sound.SoundId = "rbxassetid://"..songid sound:Play() wait(sound.TimeLength) sound:remove() end)
If You Have Any problems Feel Free To Contact Me On Discord: Harry_TheKing1#2303