So i am woundering why isn't this working to transfer this hit function from a local script to a server script with a remote event.
Local Script:
mouse.Button1Down:connect(function() local value = Stats[Equipped]["Cooldown"] if not cooldown and not Attacking then local playAnim = char.Humanoid:LoadAnimation(anim) playAnim:Play() if not cooldown then Attacking = true end if Class == "Axe" then local weapon = ActiveWeapon:FindFirstChild(Equipped) if Attacking == true then weapon["Blade"].Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if not deb then deb = true Remotes["TakeDamage"]:FireServer(hit, Stats[Equipped]["Damage"]) end end end) end end -- WEAPON COOLDOWN SYSTEM -- for i = value,0,-1 do cooldown = true wait(.65) end cooldown = false Attacking = false deb = false end end)
Server Script:
Remotes["TakeDamage"].OnServerEvent:connect(function(hit, dmg) print(hit.Parent.Name) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent:FindFirstChild("Humanoid"):TakeDamage(dmg) end end)
you shouldn't need a remoteevent if i'm interpreting this correctly.
weapon["Blade"].Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if not deb then deb = true hit.Parent.Humanoid:TakeDamage(dmg) wait(2) end deb = false end end)