Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

4 comments

0

what the error causes is that the bullets spawn in one place and dont go forward

0

uhh which here is line 16???

0

thats cuz u never even told the bullet to go anywhere in the script

0

You should mark where line 16 is next time you post a question.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.