Hey guys! I’m making this fighting game but my combat script isn’t working.
It says something like “LeftArm is not a valid member of Model”
here’s the script:
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
local Humanoid = Player.Character.Humanoid
local UIS = game:GetService("UserInputService")
local debounce = false
local Punch = script.Punch
local Punch2 = script.Punch2
local LeftArm = game.Players.LocalPlayer.Character["LeftArm"]
local Table = {LeftArm}
UIS.InputBegan:Connect(function(Input, IsTyping)
if IsTyping then return end
if not debounce then
debounce = true
if Input.KeyCode == Enum.KeyCode.Z then
local PunchTrack = Humanoid:LoadAnimation(Punch)
PunchTrack:Play()
end
wait(1)
debounce = false
end
end)
local RmtEvent = game.ReplicatedStorage.Punch
for i,v in pairs(Table)do
v.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")then
RmtEvent:FireServer(hit.Parent)
end
end)
end
Is there any errors I’ve placed? Any corrections I need to put in?