I keep getting the same error and I have no idea how to fix it. I am new to scripting and I was following this tutorial here: https://www.youtube.com/watch?v=vh8Ggpp_RR4
Code:
Enabled = true
script.Parent.OnServerEvent:Connect(function(Player, Action, V1)
local c = Player.Character
if Enabled == false then return end
if Action == "AS" then
local Punch = Instance.new("Animation")
Punch.AnimationId = "rbxassetid=5236034047"
local Anim = c.Humanoid.LoadAnimation:(Punch)
Anim:Play()
wait(0.2)
local Region = Region3.new(V1-Vector3.new(3,3,3),V1+Vector3.new(3,3,3))
local RTable = workspace:FindPartsInRegion3(Region,nil,20)
for i,v in pairs(RTable) do
if v.Parent:FindFirstChild("Humanoid")and v.Parent:FindFirstChild("Deb") == nil and v.parent ~=c then
local Deb = Instance.new("BoolValue",v.Parent)
Deb.Name = "Deb"
game.Debris:AddItem(Deb,0.2)
v.Parent.Humanoid:TakeDamage(20)
end
end
end
end)

2 comments
Put that in a code block please
It is in a code block now