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

Bug or simple mistake in my gun's sound script?

I've been trying to make a gun in my game for a little bit, im having a little trouble with the sound though. I have put my gun in the starter pack and the sound in there too. Whenever I test the script, it says GS is not a valid member of Tool "Players.NovaGooBoom.Backpack.GUNFORGAME"

Script:

local sound = tool.GS
tool.Activated:Connect(function()
	sound:Play()
end) ```

 Thanks

1 answer

✓ Accepted answer

Assuming that the script is in the tool, your sound is probably NOT in the tool, and assuming that it's in the starterpack/backpack you will just simply need to change from this:

local tool = script.Parent local sound = tool.GS tool.Activated:Connect(function() sound:Play() end)

To this:

local tool = script.Parent local sound = tool.Parent.GS tool.Activated:Connect(function() sound:Play() end)

1 comment

0

Sound was in the tool, but instead I just moved the sound and changed the variable to that. Helped me work through this though, so thanks.

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