#When to use SoundService

1 messages · Page 1 of 1 (latest)

empty kite
#

Hi yall, im working on a weapons system for an fps game. Rn, im basically just storing the ids of the sounds in a config file for all the weapons and just playing them when needed.

This is the code (all the weapons inherit from the base weapons class)

function BaseWeapon:_init()
    …

    local temp = {}
    for i,v in self.Sounds do
        local sound = Instance.new(Sound)
        sound.Name = i
        sound.SoundId = “rbxassetid://“..v
        temp[i] = sound
    end
    self.Sounds = tem

    …
end

Im just wondering if using SoundService would be better practice, as Ive heard all the weapon shoot effects, etc should be grouped together in there. I just need to make some sounds will play only for the client (eg reloading), and others are proximity (eg gunshots). Thanks!

livid rapids
#

you can put them there but if you do there's no 3d audio, which makes sense for any ui sounds and things that are heard globally, sometimes makes sense for gun sounds for the localplayer

tranquil driftBOT
#

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