the remote event wont print what i want it to print
this first script is the local script and the second one is in server script service the local script ends at line 42
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() wait(0.1) if not IsQkeydown(Q) then end end end user.InputBegan:Connect(Input) punch:FireServer()
local ReplicatedStorage = game:GetService("ReplicatedStorage") local punchevent = Instance.new("RemoteEvent", ReplicatedStorage) punchevent.Name = "CreatePartEvent" local function onpunch(player) print ("safe") end local enemy = game:FindFirstChild("Humanoid") punchevent.OnServerEvent:Connect(onpunch)
On the server you're calling "punchevent" "CreatePartEvent", but on the client you're looking for "PunchEvent", also you probably shouldn't use the second argument of Instance.new to set parents.