Hello, for some reason, every time I try to use a child of a player’s character, it says “tried to index nil with (bodypart)”. Here is my script:
local UIS = game:GetService("UserInputService")
local player = game:GetService("Players").LocalPlayer
local character = player.Character
local lBolt = game:GetService("ReplicatedStorage").Bolt
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.F then
local bolt = lBolt:Clone()
bolt.Parent = workspace
bolt.Position = character.LeftHand.Position
end
end)