I have try over and over and over again so many times but this is the same type of error I'm facing again.They said that 'Character' is a nil value.I don't understand what they mean.
I'm trying to make a projectile get thrown by using UserInputService.
local player = game.Players.LocalPlayer
local Character = player.Character
local db = true
UIS.InputBegan:Connect(function(Input, IsTyping)
if IsTyping then return end
local KP = Input.KeyCode
if KP == Enum.KeyCode.E and db then
if db == true then
db = false
mic:Clone()
mic.Name = "MicToss"
mic.Parent = Character
mic.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0.5,0,-5)
local BV = Instance.new('BodyVelocity')
BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
BV.Velocity = Character.Torso.CFrame.LookVector * 100
BV.Parent = mic
end
end
It is line 14 where I get the error.

5 comments
if Character ~= nil then
works every time
oh
where are you running this script from?
A local script in StarterPack