the error is here cuz it wouldn't fit up there XD error : Players.mewant_taco.Backpack.Pistola.CódigoPrincipal:18: bad argument #3 to 'Size' (Vector3 expected, got number)
this is the code i made (some of the thing are in portuguese XD)
local pistola = script.Parent -- Lista de Valores -- local ammo = 12 local maxAmmo = 64 local damage = 20 local headshotDamage = 50 local range = 100 local coolDown = 1.5 -- Som de Disparar -- pistola.Activated:Connect(function() pistola.Handle.Disparo:Play() end) --Dsiparar a bala-- pistola.Activated:Connect(function() local bullet = Instance.new("Part") bullet.Size = range,0.52,0.52 bullet.Position = game.StarterPack.Pistola.Hole.Position end)
Pls help me solving this thing.
Ok so, Denny9876 said i need to use a Vector3 and that's what i did, and the error is gone, but now the bullet wont appear. Here's the new code:
local pistola = script.Parent local hole = game.StarterPack.Pistola.Hole -- Lista de Valores -- local ammo = 12 local maxAmmo = 64 local damage = 20 local headshotDamage = 50 local range = 100 local coolDown = 1.5 -- impedir spamming -- local spam = false -- Disparo -- pistola.Activated:Connect(function() if spam == false then spam = true pistola.Handle.Disparo:Play() local bullet = Instance.new("Part") bullet.Size = Vector3.new(range,0.25,0.25) bullet.CFrame = CFrame.new(hole.CFrame.Position) bullet.Transparency = 0.5 bullet.CanCollide = false spam = false end end)
Pls help me fixing this.