Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to fix 15:44:29.596 ServerScriptService.BulletCreate:16: attempt to index nil?

Asked by 3 years ago

help pls this is the parts of code that are important in this situation

local ServerStorage = game:GetService('ServerStorage')

remoteEvent.OnServerEvent:Connect(function(player, gunPos, mosPos)

    local bullet = Instance.new('Part')
    bullet.Name = "Bullet"
    bullet.Parent = game.Workspace
    bullet.Shape = Enum.PartType.Ball
    bullet.Size = Vector3.new(0.5, 0.25, 0.5)
    bullet.BrickColor = BrickColor.new("Gold")
    bullet.Orientation = Vector3.new(0, -90, 0)


    local damageScript = ServerStorage:FindFirstChild('Damage'):Clone()
    damageScript.Parent = bullet
0
what the error causes is that the bullets spawn in one place and dont go forward Iamverychill2 4 — 3y
0
uhh which here is line 16??? sne_123456 439 — 3y
0
thats cuz u never even told the bullet to go anywhere in the script sne_123456 439 — 3y
0
You should mark where line 16 is next time you post a question. lilly23443234765434 20 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

NVM IT WAS JUST I DELETED A IMPORTANT PART

Ad

Answer this question