#how do i make a bullet not damage the one who fired it

1 messages · Page 1 of 1 (latest)

errant eagle
#

i made a gun, it works perfectly, i made the script for the bullet where if it touches someone it damages them, and it works except it damages also the one who fired it while they are moving. i tried to counter that with an objectvalue but it still doesn't work. (also the bullet gets fired in workspace)

olive smeltBOT
#

studio** You are now Level 9! **studio

lean gate
#

u should be doing raycasts

#

BUT

#

uh

#

what is script.Parent.Value

errant eagle
lean gate
#

ye ye but what is it set to

errant eagle
#

the character of the player

lean gate
#

r u sure that its the char?

#

print it

#

rq

proper garden
#

also they're still different objects even if their name are the same

lean gate
#

my idea would be just store players name

proper garden
#

id get the player from the tool since im assuming its a tool

errant eagle
proper garden
proper garden
lean gate
#

so what does it print

proper garden
errant eagle
#

nvm i realized my mistake i forgot to put .value after the value

lean gate
#

lol

proper garden
#

its still not going to work

errant eagle
lean gate
#

it could

#

worst with accessories

#

tho

#

would not damage if hits accessory

proper garden
lean gate
#

cuz it hits handle

proper garden
lean gate
proper garden
#

idk what script.parent.value is but the character is not a value

#

therefore they cannot be the same instance

lean gate
proper garden
lean gate
#

just

#

dont confuse him more

errant eagle
lean gate
#

if it works it works

#

even tho he shouldnt use this at all

lean gate
#

so if u gonna want make it way better pls use raycasts

#

😭

errant eagle
lean gate
#

its like 10 lines

lean gate
proper garden
#

@errant eagle

lean gate
proper garden
lean gate
#

bro stop confusing him more 😭

errant eagle
# lean gate raycast

idk how to do that i coded with raycasts only one time and forgot how to work with it again

lean gate
#

theres tutorials tho

lean gate
#

all i said is to stop confusing him...

proper garden
errant eagle
proper garden
#

his code shouldnt work objectively

#

even if he says it works, i dont believe it

lean gate
#

and should

#

bud

#

Value is set to Charcter of shooter

#

hit.Parent is character of hit

proper garden
#

stringvalue?

lean gate
#

read

#

object value

#

he said that

proper garden
#

objectvalue right right

#

ohh i see now

#

yeah ive never seen somebody use objectvalues before

lean gate
proper garden
#

you should reconsider, @errant eagle but at the same time its your choice on whether or not you want to since it works anyway

proper garden
#

yeah i noticed now

#

you used a objectvalue

lean gate
#

so a tool

errant eagle
#

and the bullet goes towards the mouse

proper garden
errant eagle
#

thats what the localscript is for

proper garden
#

adding a layer of complication

errant eagle
#

so how would u parent it

lean gate
#

ball

#

do u know basics

#

or bit more advanced

errant eagle
errant eagle
proper garden
errant eagle
proper garden
#

i wouldnt do that personally but it makes sense why you'd use objectvalue for it now

#

much more convenient

lean gate
#

if u got any questions lmk

errant eagle
# lean gate https://devforum.roblox.com/t/how-to-make-a-raycasting-gun/723716

the thing is raycasts spawn immediately and damage the player, i want the bullet to first reach the player to damage. also i need bullets to be an object cuz i'm working on a game where not only players will be damaged, but "custom enemies" too which don't use humanoids so they need to be touched by actual bullets to be damaged

lean gate
#

i see

#

that would be bit harderr

#

so fair enough if u wanna keep using your system

#

its not best but if its enough for u go ahead

proper garden
#

also they can have delays as well

#

personally i wouldnt use physics based bullets for a gun system

#

theres a lot of complications involved

#

if you do wish to see the bullet travel though, i suggest looking into fastcast

errant eagle
# proper garden also they can have delays as well

that wouldnt quite work, let's say a sniper was far away from their enemy, and they manage to kill him, but it would have the same delay as if it was like 2 studs in range. not very realistic is it?

proper garden
#

theres probably some way to add bullet travel time to raycasts or whatever, plenty of games do it

#

but in your shoes i'd probably just learn fastcast

#

it does exactly what you want

#

dummies vs noobs uses it

#

join their game and test out recon sniper on an open terrain map

olive smeltBOT
#

studio** You are now Level 5! **studio

errant eagle
proper garden
#

raycasts by themselves are invisible nonexistent thin lines

#

but you can create part vizualizers like the one in the tutorial that the other guy sent you

#

you can also just do the tank exploding thing in the gun script itself if you want, maybe making it look good/less messy by using modulescripts

#

i wouldnt go down that route though

#

your current tactic is good

errant eagle
#

i'll look into raycasting and stuff

proper garden
#

also its very complicated

#

if you want to make a gun system like in the big games

#

its gonna take a lot of effort

#

i was making my own at some point but i kinda got suck at the ping part

spark zealot
#

Guys guys just use chat gpt frfrfrrfrrfrrfrrrrfr

proper garden
#

with the help of a few posts, i found out how to combat it though

proper garden
spark zealot
proper garden
#

i was also