#Question on gun raycast and bullet making

1 messages · Page 1 of 1 (latest)

jovial helm
#

I want to make it so the raycast doesn't damage you, but the bullets created by shooting the gun hurt when it touches someone. how can i do that?

sullen relic
jovial helm
#

huh?

sullen relic
#

in your server script

#

when the raycast is checking for a model, also check if the model also the character is not equal to the player who fired the event

jovial helm
#

i want it so that when the player fires the bullet, the bullet is the thing that does the damage, not the raycast

sullen relic
#

wow

#

literal idiot moment right here, i am soo sorry i completely read that wrong

#

try this

jovial helm
#

i am not smart enough for that

halcyon anvil
#

why would u even wanna do that

#

nust make the raycast do it

jovial helm
#

i want to make a game where if you have the least kills at the end of the round, you can choose a card to upgrade yourself, and i dont want it to hit anyone from anywhere

halcyon anvil
#

juust try excluding the descendants by the params

#

and it wouldnt hit anyone

#

oh uve alr done that

#

nvm

#

nvm

jovial helm
#

making the bullets cause the damage would make it so you can't hit anyone from anywhere

hybrid abyssBOT
#

studio** You are now Level 1! **studio

jovial helm
#

got it to do what i want but now when i kill someone it only kills them for me and they are still alive

jovial helm
#

the what

sullen relic
#

bullet.touched function

jovial helm
#

oh shoot

#

alright

sullen relic
#

if you run it in a localscript it only replicates to you

#

server scripts replicates it to all

jovial helm
#

i tried doing this but they stopped taking damage and it says im trying to index nil with take damage

sullen relic
jovial helm
#

clear the errors?

sullen relic
#

only send hit.Parent if it's a player

jovial helm
#

oh right

sullen relic
#

cause the bullet is touching other parts that isn't a player

jovial helm
#

thank you

#

ill have to try that tomorrow though

jovial helm
#

now my bullets pass through walls ):