so i made like kind of mechanics in ninja legends 2 when you hit the ground after jumping it made like a crack but it just comes with the error attempted to index nil with 'Instance' Local Script :
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(k,p)
if p then return end
if k.KeyCode == Enum.KeyCode.Space then
wait(0.2)
local raycastparams = RaycastParams.new()
raycastparams.FilterDescendantsInstances = {game.Players.LocalPlayer.Character}
raycastparams.FilterType = Enum.RaycastFilterType.Blacklist
local ray = workspace:Raycast(game.Players.LocalPlayer.Character.HumanoidRootPart.Position,game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.UpVector*-7,raycastparams)
local part = Instance.new("Part")
if ray.Instance ~= nil then
part.Parent = workspace
part.Anchored = true
part.CFrame = CFrame.new(ray.Position,ray.Position + ray.Normal)
end
end
end)
