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)
01 | local pistola = script.Parent |
02 | -- Lista de Valores -- |
03 | local ammo = 12 |
04 | local maxAmmo = 64 |
05 | local damage = 20 |
06 | local headshotDamage = 50 |
07 | local range = 100 |
08 | local coolDown = 1.5 |
09 |
10 | -- Som de Disparar -- |
11 | pistola.Activated:Connect( function () |
12 | pistola.Handle.Disparo:Play() |
13 | end ) |
14 |
15 | --Dsiparar a bala-- |
16 | pistola.Activated:Connect( function () |
17 | local bullet = Instance.new( "Part" ) |
18 | bullet.Size = range, 0.52 , 0.52 |
19 | bullet.Position = game.StarterPack.Pistola.Hole.Position |
20 | 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:
01 | local pistola = script.Parent |
02 | local hole = game.StarterPack.Pistola.Hole |
03 |
04 | -- Lista de Valores -- |
05 | local ammo = 12 |
06 | local maxAmmo = 64 |
07 | local damage = 20 |
08 | local headshotDamage = 50 |
09 | local range = 100 |
10 | local coolDown = 1.5 |
11 |
12 | -- impedir spamming -- |
13 | local spam = false |
14 |
15 | -- Disparo -- |
Pls help me fixing this.