How do I make this Key Input local script affect the server and not client sided

How do I make the Ragdoll and Health value server sided. When the script runs its client sided. Its user input activated so the script needs to be local but that’s the reason the Values won’t change to server sided. I’ve looked everywhere for solutions any help.

wait(1)
local plr = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local active = false
wait(.1)
local torso = plr.Character:WaitForChild("UpperTorso")
local Swinging = script.Swinging
local SwingingTrack = torso.Parent.Humanoid:LoadAnimation(Swinging)
local HittingDown = script.HittingDown
local HitDownTrack = torso.Parent.Humanoid:LoadAnimation(HittingDown)
local Kick = script.Kick
local KickTrack = torso.Parent.Humanoid:LoadAnimation(Kick)
local RightPunch = script.RightPunch
local RightPunchTrack = torso.Parent.Humanoid:LoadAnimation(RightPunch)

-- swing

UIS.InputBegan:connect(function(input,gameProcessedEvent)
	if not gameProcessedEvent then
		if input.KeyCode == Enum.KeyCode.E and active == false then
			local p = game.Players.LocalPlayer.Character
			p.Humanoid.WalkSpeed = 6
			SwingingTrack:Play()
			plr.Character.LeftHand.FightHit.HealthValue.Value = 0.006
			plr.Character.LeftHand.FightHit.RagdollValue.Value = 0.035
			plr.Character.RightHand.FightHit.HealthValue.Value = 0.006
			plr.Character.RightHand.FightHit.RagdollValue.Value = 0.035
			local c = p.HumanoidRootPart
		end
	end
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.