Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't the Vector3 working to set the Size of a part?

Asked by 6 years ago

I was making a gun to my game, and i made a code, but then i started getting an error. Then a guy named "Denny9876" told me to use a Vector3 to my code. And then the error was gone! But then, the code wasn't working, only the error was gone.

This is my code:

01local 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 --
View all 27 lines...

Pls tell me what is wrong with my code, why isn't the bullet showing up, and how can i fix it?

0
You didn't anchor the "bullet", thus it fell through the ground, also, the line "bullet.CFrame = CFrame.new(hole.CFrame.Position)" is unnecessary, you can just do bullet.CFrame =CFrame.new(hole.Position) theking48989987 2147 — 6y
0
Thank you mewant_taco 17 — 6y

1 answer

Log in to vote
1
Answered by
aazkao 787 Moderation Voter
6 years ago
Edited 6 years ago

You forgot to parent the Bullet instance to workspace

01local 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 --
View all 28 lines...
0
thx mewant_taco 17 — 6y
Ad

Answer this question