:FireAllClients() doesn’t replicate to players that joined after it has been executed.
For example:
:FireAllClients() is called and a client-sided grey ball is replicated to all players in the server.
A new player joins the server, but they don’t see the grey ball because they weren’t there when :FireAllClients() was executed.
How can I fix this?
I heard Client is best for handling things like effects and vfx. But what if you want that VFX to last a certain amount of time?
• Such as… a fire tornado! The fire tornado is summoned and moves towards other players. The tornado will last a certain amount of time before disappearing. Since this tornado is replicated to all players via FireAllClients(), it won’t be visible to any new players that joined after. Only to the ones who was there when it was created.
(Note: The actual hitbox is invisible and handled on server. It will move to the exact same locations as the client fire tornado)
To new players who joined after, it will look like an invisible force (hitbox) is damaging the players. Is there any way to manage or fix this?? Please share with me ur knowledge
Its pretty much self-explanatory, It seems like you are creating something on the client and trying to replicate it to each client. its either you have an update function that is constantly detects if it doesnt exist then just keep firing the FireAllClients() until it exists. or just copy-paste the .OnClientEvent to a OnServerEvent and just fix the code up from that side.
What you could do is store any ability casted (you just need to store the name) in a table. When a new player joins → loop through this table → get the ability/effect and play it on the client.
When the ability ends you just fireAllClients from the server to remove any effects playing for the current players → you would also remove the ability name from the table so future players don’t play it.
This is just a potential solution I could think of off the top of my head.
I think you’re overcomplicating things a bit. You can just create your VFX instances on a server-side script and it’ll automatically replicate to every player. You only want to handle VFX on the client for individual occasions. (Ej. when a player picks up a coin and you play an animation specifically for that player)
The movement will only be choppy if you have high latency, and if you do, it’ll still look rough either way. You need a way to tell the client where the tornado is going next, and if you have a lot of latency, it’s not gonna look smooth.
Edit:
You could probably make a hybrid system where the tornado instance is created on the server side and eases on the client side to the next location it gets from the server, but it seems like a daunting task considering you’d need to handle new players joining, syncing it with the hitbox, etc…
By parts, do you mean the tornado? Wouldn’t I need to have an event that detects everytime a player joins and fireclient the already-existing effect to them?