i’v been following this tutorial (https://www.youtube.com/watch?v=y4fpzKz-hiY&t=1185s)
at the first testing i encountered the problem attempt to index nil with cframe in the 30th row
but the nil is not really a nil couse its exists in the workplace
i looked on the internet but the other problems not similar to mine
local rs = game:GetService("ReplicatedStorage")
local animations = rs.grabmove.Animations
local Handler = {}
Handler.playerdebounce = {}
Handler.confirmedtarget = {}
Handler.cooldown = 1
function Handler:PlayAnimations(humanoid: Humanoid, TypeOfAnim: string)
local currentanimation
if TypeOfAnim == "user" then
currentanimation = humanoid.Animator:LoadAnimation(animations.gAnimate1)
elseif TypeOfAnim == "target" then
currentanimation = humanoid.Animator:LoadAnimation(animations.gAnimate2)
end
return(currentanimation)
end
function Handler:Spawnhitbox(player, root)
local Folder = Instance.new("Folder")
Folder.Name = "GrabMove"
Folder.Parent = workspace
local Hitbox = rs.grabmove.Hitbox:Clone()
Hitbox.Parent = Folder
Hitbox.CFrame = root.CFrame * CFrame.new(0,0, -2,5)
local weld = Instance.new("Weld")
weld.Part0 = Hitbox
weld.Part1 = root
weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0
end
return Handler