Making a skill system and before the move freezes you, you can spin around. However the server lag causes the hitbox to spawn elsewhere on the server rather where the client is facing
So i need to pass the hrp info from the client to the server.
I’ve tried doing this using onclientinvoke but it doesnt seem to work. Furthermore i also need this info for NPCS so it cant be player locked.
Any solutions?
Update
game.ReplicatedStorage.Remotes.Other.ClientHrpRotation.OnClientEvent:Connect(function(player, orientation)
local char = player.Character
local hrp = char:FindFirstChild("HumanoidRootPart")
if orientation then
hrp.CFrame = CFrame.new(hrp.Position) * CFrame.Angles(0, math.rad(orientation.Y), 0)
end
end)
i did this ^ and:
game.ReplicatedStorage.Remotes.Other.ClientHrpRotation:FireAllClients(player, hrp.Orientation)
which works great. But how would i do the same for npcs.
Quick question. By NPCS do you mean getting their humanoid root part information as well?
so essentially imagine you’re about to do a beam move. but before u freeze u spin around. the orientation on the server is different to the client. Before i get the npcs working i need to get the players working.
The npc skills are fully server handled but its still weird it has slight lag. Also the script i shared is still buggy. i need the server and client hrp to be aligned.
I don’t knwo for sure but i might have fixed it, i switched to server event. idk why i did client but ill test with other clients active as well
If you still have the same issue you can use an UnreliableRemoteEvent
But only downside of an UnreliableRemoteEvent is that its not as safe(Meaning that the server may not get it) but the pro is that it might be faster, but I don’t know i dont use it that much. Good luck though! 