I’m currently scripting my first sword system, and I want to put in a feature where the player can kick. And if you were to get hit by this kick, you’d get staggered. Problem is, I have no clue how I’d communicate this between the server and client. Does anyone have some ideas? Thanks in advanced!
If you want to use UserInputService, you can monitor that in a LocalScript and if the player presses “K” for example to kick then you can run the animation and then fire a RemoteEvent that can handle slowing down the other player on the server-side, then setting their state back to normal.
I would defenitely recommend making a “camera shake” effect, this is something I have also been looking into however I do not really know how to make it.
What does this mean? No, the stun shouldn’t be on the client, you should never trust the client with anything important, exploiters can screw with your game if you do.
And anyway, one of the qualities of causing an effect on the server is that everyone sees the effect. If you change the the time of day to midnight, it becomes midnight for everyone. If you use a localscript to change time of day, only you see it.
In short, if you only stun someone on the client, only you will see it (only you will see the effects of the stun, such as the player freezing in place), but in reality they’ll be able to walk around just fine, it would look very strange. If you stun them on the server instead, everyone sees them as stunned.
Also, if you play an animation on the client, only you will see the animation happen (I think). Play an animation on the server.
Anything you want everyone to see or everyone should be affected by should happen on the server.
What does this mean? No, the stun shouldn’t be on the client, you should never trust the client with anything important, exploiters can screw with your game if you do.
Not what I meant, I was asking because I thought that properties like Walkspeed is a client-sided property, that’s why exploit programs can still utilize it in games.
And anyway, one of the qualities of causing an effect on the server is that everyone sees the effect. If you change the the time of day to midnight, it becomes midnight for everyone. If you use a localscript to change time of day, only you see it.
Again, there’s no confusion on how local scripts and normal scripts work. It feels like your post is a tad argumentative, in a place where it really doesn’t need to be. Sorry you had the confusion.
Also, if you play an animation on the client, only you will see the animation happen (I think). Play an animation on the server.
If you play an animation on the Client, it gets replicated to the server. So no need to play it again on the server.