#Gun Problems

1 messages · Page 1 of 1 (latest)

inner glen
#

I made a rifle that fires a bullet every .15 seconds, it works except for what the bullet is supposed to do. Whenever im using the gun, the bullet just deletes itself without even loading its BodyVelocity. I put in a table for the limbs (which i figured wouldnt work), made it so that if its touching a limb from the player it wont destroy itself, and made sure if its touching the rifle it wont destroy itself. Still, its deleting itself. Please help.
I just put a part of the script, if you need the entire script notify me.

    if t.Parent.Parent.Name ~= Player.Name  or t.Parent.Name ~= "Rifle" then
        copybullet:Destroy()
        if t.Parent.Name == "Experiment 32: The Living Robot" then
            local Hum = t.Parent:FindFirstChildOfClass("Humanoid")
            Hum:TakeDamage(20)
        end
    end
end```
civic copper
#

i would just make all players have a hitbox part but ion think thats gonna solve the problem here

proper trellis
inner glen
#

i used a local for the bullet then in the copy function i made another local for it

#

it works normally without the touch function, but when i use it, it just disappears

proper trellis
#

probably the bullet is touching another bullet

inner glen
#

wait ill try it again

#

nah

#

if i shoot it once

#

it still does the same thing

#

appears

#

then disappears

#

gone

civic copper
#

or give the model a player tag

#

idk

proper trellis
#

if you are, i'd recommend fastcast

inner glen
#

its just

#

BodyVelocity onto a part

proper trellis
#

yeah bodyvelocity is a physics constraint

#

you are making physics bullet

inner glen
proper trellis
# inner glen how???
inner glen
#

i think i might as well just make a ray

#

and make the part tween to the end of it