Jump to content

Recommended Posts

I'm working on a mod where, after a certain amount of time, a specific song starts playing. It's supposed to follow the player as they move, but it currently seems to be stuck in a specific spot. How would you get the sound to move?

I'm currently using AddClientModRPCHandler in the modmain lua, and SendModRPCToClient in the character lua.

Is there something else I should be doing? 

 

In the character lua: (This is inside of a timer that determines how long it will take for the song to play

			  inst:ListenForEvent("timerdone", function(inst, data)
				if data and data.name == "EndSong" then
				SendModRPCToClient(GetClientModRPC("hatchling", "songcall"), inst.userid)
				print("playing song with RPC") 

In the modmain:

-- Client RPC Handler for EndSong
AddClientModRPCHandler("hatchling", "songcall", function() --"hatchling" is the namespace, needs to be unique. "songcall" is the name, this is how I'll call it later.
  GLOBAL.TheFocalPoint.SoundEmitter:PlaySound("customvoice/EndTimes/EndSong")
end)

 

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