Jump to content

Recommended Posts

I made a playermod for the youtuber OrangE and someone suggested making him say "Hello Everyone" upon spawn and I really want to do that. How??? 

yt5s.com - Hello Everyone - OrangE Soundbite #1 (128 kbps).mp3

Assuming you want your character to play this sound whenever it appears in the world you can simply put:

inst.SoundEmitter:PlaySound("your_sound")

in your characters fn() after:

if not TheWorld.ismastersim then
	return
end

This way your character will play your sound every time it joins a server or switches from surface to caves and vice versa.

 

If you want to play the sound only when your character is created (so only play the sound once) you would need to listen for the "ms_newplayerspawned" event and play the sound then.

  • Like 1
On 4/5/2022 at 7:11 AM, -t- said:

Assuming you want your character to play this sound whenever it appears in the world you can simply put:


inst.SoundEmitter:PlaySound("your_sound")

in your characters fn() after:


if not TheWorld.ismastersim then
	return
end

This way your character will play your sound every time it joins a server or switches from surface to caves and vice versa.

 

If you want to play the sound only when your character is created (so only play the sound once) you would need to listen for the "ms_newplayerspawned" event and play the sound then.

Hello i know this is MONTHS later but i'm not sure howto put this in? image.thumb.png.fab6234b46d9780c370f4e8bde4116af.png

In your characters file you should have a function called 'fn()'.

In this function there should be a piece of code that looks like this:

if not TheWorld.ismastersim then
    return inst
end

Put 'inst.SoundEmitter:PlaySound("your_sound")' after that.

 

From what you sent it seems your trying to play the '.mp3' file directly, which is not possible. You need to create a '.fsb' file using FMOD Designer. You can find it in your Don't Starve Mod Tools. If you don't know how to create sounds I recommend this tutorial:

 

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...