i recently made a fps game but the bullet hole thing doesn't work. it comes with a error that says Players.IEntity_303I.Backpack.LocalScript:22: attempt to perform arithmetic (add) on nil - heres the script :
local cam = workspace.Camera
local Mouse = game.Players.LocalPlayer:GetMouse()
local Hand = game.Players.LocalPlayer.CharacterAdded:Wait():WaitForChild("Right Arm"):Clone()
local Model = Instance.new("Model")
Model.Name = game.Players.LocalPlayer.Name.."'s Model"
Model.Parent = workspace
Hand.Parent = Model
Hand.Name = "RightArm1"
game:GetService("RunService").RenderStepped:Connect(function()
for i = 0,1,.0001 do
wait()
Hand.CFrame = Hand.CFrame:Lerp(cam.CFrame * CFrame.new(1,-1,-2), i)
end
end)
Mouse.Button1Down:Connect(function()
local Decalpart = Instance.new("Part")
local hit,pos,normal = workspace:Raycast(Hand.Position,Hand.CFrame.LookVector)
Decalpart.Transparency = 1
Decalpart.Size = Vector3.new(1,1,1)
Decalpart.Parent = workspace
Decalpart.CFrame = CFrame.new(pos,pos + normal)
local decal = "rbxassetid://73737626"
decal.Parent = Decalpart
decal.Face = "Front"
end)

9 comments
ok
what would i write in the Decalpart.CFrame tho
CFrame.new(RaycastResult.Position, RaycastResult.Position + RaycastResult.Normal) as you did, that is the same.
tysm
but it appears behind me not on the wall
nvm i have to use ignore list
still is on my head
Raycast accepts third argument, that is RaycastParameters, you can specify FilderDescendantsInstances which are instances which's descendants will be filtered, check it out: https://developer.roblox.com/en-us/api-reference/datatype/RaycastParams
nvm