#how do i make a bullet not damage the one who fired it
1 messages · Page 1 of 1 (latest)
** You are now Level 9! **
thats a terrible way to do hit detection
u should be doing raycasts
BUT
uh
what is script.Parent.Value
the objectvalue
ye ye but what is it set to
thats a terrible way of doing it no offense
also they're still different objects even if their name are the same
my idea would be just store players name
id get the player from the tool since im assuming its a tool
im doing it the classic way
idk what classic way that is
then id use getplayerfromcharacter
so what does it print
and id check if THAT is equal to hit.parent
nvm i realized my mistake i forgot to put .value after the value
lol
its still not going to work
it works fine
if hit.Parent ~= script.Parent.Value then
cuz it hits handle
im assuming hit.Parent is the character you hit
thats what he does
idk what script.parent.value is but the character is not a value
therefore they cannot be the same instance
yeah i quoted it
no i put if hit.Parent ~= script.Parent.Value.Value now and it works
out of curiosity
can u recommend a different system then
its like 10 lines
raycast
print hit.Parent and script.Parent.Value.Value plz
@errant eagle
like he said
Value is character of shooter
and their classnames
bro stop confusing him more 😭
idk how to do that i coded with raycasts only one time and forgot how to work with it again
how do u shoot bullet?
theres tutorials tho
all i said is to stop confusing him...
is printing something confusing
local script, remoteevent and server script
and it works
and should
bud
Value is set to Charcter of shooter
hit.Parent is character of hit
objectvalue right right
ohh i see now
yeah ive never seen somebody use objectvalues before
a tool or mouse?
you should reconsider, @errant eagle but at the same time its your choice on whether or not you want to since it works anyway
it works perfectly
so a tool
but if you could get the shooter character in the first place why did you put it in an objectvalue
thats what the localscript is for
adding a layer of complication
cuz the bullet is in workspace, not the character or the gun
so how would u parent it
kinda
kinda
ohh you put the script in the bullet
yea
i wouldnt do that personally but it makes sense why you'd use objectvalue for it now
much more convenient
Preface Alright so the developer hub and old wiki had this, although a few months ago it was removed from the former because it was just so terribly outdated it was a joke. So I thought I should revive that old tutorial. A lot has happened since that tutorial, like new raycasting api being added and filtering enabled being enforced and that tu...
if u got any questions lmk
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
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
raycasts can damage npcs as well
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
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?
thats fair
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
https://devforum.roblox.com/t/how-do-i-make-bullet-travel-using-raycast/951981
https://www.reddit.com/r/roblox/comments/8o6zw8/how_do_i_make_bullet_drop_using_raycasting/
** You are now Level 5! **
also raycasts aren't actual objects and you can't set properties to them, which is a problem for these old systems which i'm using
well thats where the vizualizer comes in
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
thanks
i'll look into raycasting and stuff
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
Guys guys just use chat gpt frfrfrrfrrfrrfrrrrfr
with the help of a few posts, i found out how to combat it though
smartest roblox studio community member
I was joking
i was also