23:18:53.481 - Players.Player.Backpack.Tool.LocalScript:84: 'end' expected (to close 'function' at line 28) near ''
--[[Scripted by WolfgangVonPrinz]]--
--[[ Thank you for using my gun kit!
It's very much appreciated, this kit is a work in progress, but while it will never be
as large as Turbo's, it'll be a more solid design, that will loke a lot better.
--]]
--[[SETTINGS]]--
damage = 30 -- Set this to how much damage you want the gun to do
RPM = 600 -- How many rounds a minute can the gun fire?
ammo = 10 -- How much ammo in a clip do you want?
ammostore = 100 -- How many stored rounds do you want?
--[[SETTINGS/]]--
local tool = script.Parent
local user
local firingrate = 60 / RPM
local canfire = true
auto = false
tool.Equipped:connect(function(mouse)
user = tool.Parent
if script.Parent:FindFirstChild("ammo") == false then
print("There ain't no ammo vals! better make 'ne")
local a = Instance.new("NumberValue", script.Parent)
a.Name = "ammo"
a.Value = ammo
local b = Instance.new("NumberValue", script.Parent)
b.Name = "storedammo"
b.Value = ammostore
mouse.Button1Down:connect(function()
auto = true
while auto == true do
if canfire == false then return end
canfire = false
if ammo > 0 then
ammo = ammo - 1
-- Mah first ray evar
local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Handle.CFrame.p).unit*300)
local hit, position = game.Workspace:FindPartOnRay(ray, user)
print(hit) -- This is used for debugging
local hitted = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid")
if hitted then
hitted:TakeDamage(damage)
wait(firingrate)
canfire = true
else
print("Outta ammo broski")
end
mouse.Button1Up:connect(function()
print("Button is up")
auto = false
end)
end
end
end
)
end

1 comment
Doesn't error, but it doesn't work, either. :(