Bullets is not a valid member of tool, i have a script w/o this part (below) and it doesnt error, so idk what i did wrong... (the error part is the well part below)
script.Parent.Bullets.Changed:connect(function()
local character = script.Parent.Parent.Name
local player = game.Players:findFirstChild(""..character.."")
local ZValue = nil
local InsertedValue = nil
if (script.Parent.Bullets.Value<=0) and (debounce==false) then
if (script.Parent.Ammo.Value>0) then
debounce=true
if script.Parent.Ammo.Value + script.Parent.Bullets.Value > 8 then
script.Parent.Ammo.Value = script.Parent.Ammo.Value - (8 - script.Parent.Bullets.Value)
InsertedValue = 8
else
InsertedValue = script.Parent.Bullets.Value + script.Parent.Ammo.Value
script.Parent.Ammo.Value = 0
end
script.Parent.Bullets.Value = 0
script.Parent.Handle.Reload:play()
player.PlayerGui.GameGui.Ammo.Text = "RELOADING"
wait(1)
if script.Parent.BoltCheck.Value == true then
script.Parent.Slide.Weld.C1 = script.Parent.Slide.Weld.C1 + Vector3.new(-0.25, 0, 0)
script.Parent.Ejection.Weld.C1 = script.Parent.Ejection.Weld.C1 + Vector3.new(-0.25, 0, 0)
script.Parent.Ejection.BrickColor = BrickColor.new(2)
script.Parent.BoltCheck.Value = false
end
script.Parent.Bullets.Value = InsertedValue
debounce=false
end
end
end) |