Jump to content

Recommended Posts

7 hours ago, Nosidda said:

I've added inst.SoundEmitter:PlaySound to the shields prefab and it hasn't been working. Is there a better way to do this because I'm stumped 

image.png

image.png

image.png

image.png

Is your sound still working? you can use this code instead
 

AddPrefabPostInit("wathgrithr_shield", function(inst)
    local oldparry = inst.components.parryweapon.onparryfn
    inst.components.parryweapon.onparryfn = function(inst, ...)
        if oldparry then
            oldparry(inst, ...)
        end
        inst.SoundEmitter:PlaySound("yourparrysound")
    end
end)

 

15 hours ago, Haruhi Kawaii said:

Is your sound still working? you can use this code instead
 

AddPrefabPostInit("wathgrithr_shield", function(inst)
    local oldparry = inst.components.parryweapon.onparryfn
    inst.components.parryweapon.onparryfn = function(inst, ...)
        if oldparry then
            oldparry(inst, ...)
        end
        inst.SoundEmitter:PlaySound("yourparrysound")
    end
end)

The sound hasn't been working sadly. And using the code gives me this error. Messing around with the file paths makes hosting a world load forever. image.png.13a9d6280aa2c9d10ea9f1d44de68f1e.png

Checking client_log.txt it's the same error afaik 

15 hours ago, Nosidda said:

The sound hasn't been working sadly. And using the code gives me this error. Messing around with the file paths makes hosting a world load forever. image.png.13a9d6280aa2c9d10ea9f1d44de68f1e.png

Checking client_log.txt it's the same error afaik 

ah...
 

AddPrefabPostInit("wathgrithr_shield", function(inst)
    if not GLOBAL.TheWorld.ismastersim then
        return inst
    end

    local oldparry = inst.components.parryweapon.onparryfn
    inst.components.parryweapon.onparryfn = function(inst, ...)
        if oldparry then
            oldparry(inst, ...)
        end
        inst.SoundEmitter:PlaySound("yoursound")
    end
end)

I have attached a video on how to create sound.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...