ScrewdriverLad Posted January 2, 2023 Share Posted January 2, 2023 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) Link to comment https://forums.kleientertainment.com/forums/topic/145429-how-do-i-make-a-sound-effectsong-that-follows-my-character-as-they-move/ Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now