Making a speaker entity (music)

Hi.
I was wondering if anyone could teach me how to make a speaker entity.
A template for example.

Best Regards,
Nic

There’s no a template for that, just download a base entity and run EmitSound function on entity

Download a base entity?
I apologise, I just started with LUA.

It’s Lua.

So what he meant as a base entity, you really just need to set a basic one up.

A little dated, but it still holds true.

Using this, you could for example set up a speaker to play using…

… or you could even go a step further and…

EmitSound is shared, which means it can be done both on client and serverside, whereas PlayURL is only Clientside.

This affects where you’ll place the code for it.

Try playing with these, and see what you can come up with.