#Bullets dosent kill monster

1 messages · Page 1 of 1 (latest)

minor tartan
#

My custom gun which i animated and scripted dosent kill a custom monster with a humanoid root part but a random sword from the toolbox does the work and kills it

summer steppe
minor tartan
#

gun script

minor tartan
#

making the bullets command that if it touches smth called a humoid root part then it reduces health
i checked the print output and it shows that the humanoid root part is getting damaged but it dosent die but it dies to the classic sword

#

english is not my main language so pardon

summer steppe
#

np, not mine either

#

i understand what you said

minor tartan
#

and making the humanoid root part command that if it touches smth called a bullet then it reduces damge

#

i mean reducdes health

summer steppe
#

idk if you miss spelled but, only the Humanoid gets damaged, not the HumanoidRootPart, since it's a BasePart

#

I'll read the code

minor tartan
#

ty

#

lemme check if humanoid or humanoidrootpart was getting damaged

summer steppe
#

what is 'MuzzeFlash'

#

its some effect

#

?

minor tartan
#

guns moke

#

smoke*

summer steppe
#

ok

minor tartan
#

the humanoid got damaged

#

i checked

summer steppe
#

ok

#

is this a local or a server script?

minor tartan
#

server

summer steppe
#

alr

#

idk if it works like that

#

but

#

this is supposed to check if v.Name is equal instead of different of "creator" here?

local function UntagHumanoid(humanoid)
for _, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end

#

what is that function for?

minor tartan
#

i heard

#

by AI

#

that it detects player

#

more accurate

summer steppe
#

i don't think

minor tartan
#

oh wait

#

that part i added by AI

#

forgot to remove it

summer steppe
#

ah, ok

#

i don't recommend creating parts and detecting if they get touched

#

this is pretty unoptimized

dark vaultBOT
#

studio** You are now Level 10! **studio

summer steppe
#

consumes a lot of memory

#

instead, use raycasts and simulate the bullets on the client

minor tartan
#

mhm.

summer steppe
#

raycast is pretty easy to use and 100% more optimal

#

do you want me to help you apply it?

minor tartan
#

if u want to then sure

summer steppe
#

have you ever used raycasts before?

minor tartan
#

or try

#

i main in animating but i tried to learn scripting as well and floppy

summer steppe
#

you're an animator? cool, bro

#

I appreciatte animator's work

minor tartan
#

ty

summer steppe
#

'cause I suck at it

#

yall are magicians

minor tartan
minor tartan
#

its experience

#

not skill 🙏

summer steppe
#

I'll remember that

minor tartan
#

i need to sleep

summer steppe
#

Oh

minor tartan
#

ill see raycasts

#

tom

#

bye

summer steppe
#

Bye, good sleep

#

cya