#Grenade doesn't play sound

4 messages · Page 1 of 1 (latest)

fickle falcon
#

For some reason, when I use the grenade, there's no error, but it doesn't play the sound when it explodes. I don't know how to fix this, can anyone help me?
BTW here is the script for the grenade:
local userInput = game:GetService('UserInputService')
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local grenadeSound = Instance.new('Sound')
grenadeSound.SoundId = "rbxassetid://1449829557"

local ReplicatedStorage = game:GetService('ReplicatedStorage')
local grenadeEvent = ReplicatedStorage:WaitForChild('GrenadeEvent')

local function throw(input, gameProcessed)
if not gameProcessed then
if input.userInputType == Enum.UserInputType.Keyboard then
local keycode = input.KeyCode
if keycode == Enum.KeyCode.G then
grenadeSound:Play()
grenadeEvent:FireServer(mouse.Hit.p)
print("grenade")
end
end
end
end

userInput.InputBegan:Connect(throw)

ivory sunBOT
#

studio** You are now Level 1! **studio

fickle falcon
#

btw here is where the grenade script came from (excluding the sounds) https://www.youtube.com/watch?v=Cj_-o5Tjdtg

#RobloxStudio #FirstPersonShooter

In this video we continue to work on our first person shooter game in Roblox Studio! This time we kick things up a notch by adding grenades! The grenades are fully customizable, and you can adjust the explosion time, blast radius, throwing distance, and much more!

Other Videos in the Series

1.How to make a Gu...

▶ Play video
calm blaze
#

you didnt define the parent of the sound