I have been struggling with this for days and i dont know what to do. The serverscript code is running fine but i need help finding out how to make it damage a humanoid
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local punch = Instance.new("RemoteEvent", ReplicatedStorage)
punch.Name = "PunchEvent"
function onpunch(player)
print("start")
end
punch.OnServerEvent:Connect(onpunch)
this is the local script
local rep = game:GetService("ReplicatedStorage")
local punch = rep:WaitForChild("PunchEvent",1)
local user = game:GetService("UserInputService")
local Player = game:GetService("Players")
local player = game.Players.LocalPlayer
local character = player.Character
local human = script.Parent
local humanoid = character.Humanoid
local hmd = character:WaitForChild("Humanoid")
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://2642258675"
local Q = Enum.KeyCode.Q
local function IsQkeydown(Q)
return user:IsKeyDown(Q) end
local function Input (Input,InputObject)
if not IsQkeydown(Q) then
else
print("hit")
local AnimationTrack = hmd:LoadAnimation(anim)
AnimationTrack:Play()
punch:FireServer(print("Safe"))
wait(0.1)
if not IsQkeydown(Q) then
end
end
end
user.InputBegan:Connect(Input)

4 comments
is this event intended to only damage one humanoid (like in a boss fight) or differing humanoids (like tools)?
one humanoid
the player who fired, someone else? who
wait let me post the local script too