My game got issues with the combat in it player’s are getting hit from very far away. But for the monster, he is close to the client but for the client itself, the monster is very far away. Can one of the developers of this forum help me to find a solution?
I tried to use some modules found on the DevForum for instance: ‘ClientCast’ and more but it didn’t work. I tried using raycasting but the problem is probably the clients’ ping mine is always above 200 but when I join a game like Epic Minigames my ping is around 50 - 100. Can somebody please help me I’ve tried a lot of solutions It’s stressing me.
Code I am using right now:
newKatana.Model.Activated:Connect(function()
if not Activated then
Activated = true
if math.random(1,2) == 1 then
KatanaAttack1:Play()
else
KatanaAttack2:Play()
end
local connection = newKatana.Model.Hit.Touched:Connect(function(hit)
local Player = playersService:GetPlayerFromCharacter(hit.Parent)
local PlayerName = hit.Parent.Name
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Player and not HitDeb and not gameHandler.Wildlings[PlayerName] then
if (newKatana.Model.Hit.Position - hit.Parent.HumanoidRootPart.Position).Magnitude <= 5 then
HitDeb = true
Humanoid:TakeDamage(math.random(minDamage,maxDamage))
gameHandler.Travelers[Player.Name].killedBy = owner.Name
end
end
end)
wait(0.5)
connection:Disconnect()
end
end)
Well it there a way I can fix ping on my game? Since on a game like Epic Minigames I have a very low ping (60 - 100) and on my game I have 200+ ping all the time.