#Server script .Died not triggering
1 messages · Page 1 of 1 (latest)
this part of the script is the scenario im talking about.
i have an explosion modulescript (which is the hit) and anything that hits it will go through a whole process. However, before said process, i set the humanoid's health to 0 to trigger the .Died events. and yes this is in a server script.
no
startercharacter
and the server .Died is in serverscriptserv
also sometimes (around 60-70% of the time) my character's parts gets destroyed, i've been trying to find if theres a script responsible for it but couldnt find any
if you know whats up with that then please do tell me
but i am pretty sure its some jank script running around
where is .died connected
show code
alr im guessing ur talking about the kill:Fire()
is it there ah nvm
well i also added a print at some point
on the .Died
so the problem is actually .Died not triggering
nope
maybe do a remote event if you said it works on client but idk why it doesn't work on server it could be due to an error in explosion mod
it was originally the localscript doing the .died event
however the problem is, kills are delayed by the OTHER player's ping
so kills could just get delayed or even missing
with high enough ping
so i need 2 events
I think there's a property for explosions called break joints on death and you might need to disable that so it doesn't destroy the parts
but then I think you need to program the humanoid being killed
the module script doesnt use explosion isntances
it doesnt?
its a kill ball basically
that just grows and stuff
detects for collisions and do its thing
how come you don't include the died logic after the ball kills the player instead of setting up a died event
what if you did wait for child and then the humanoid instead of iterating through the characters children and then checking if it's a humanoid
** You are now Level 1! **
not sure how that'd help but sure i'll try it
or you could set up your own died event instead of relying on the humanoid
like a bindable event
i dont think it changed anything m8
thats basically what you suggested earlier...
is humanoid nil?
in the scenarios the humanoid is present
what about changing state to dead
lemme try that
maybe one script is running before the other
im guessing thats what the other scenario is caused by
however my search for that rogue script was not successful
add a .wait() to check or a bunch of prints to debug
i tried using that finder tool
the prints i've done so far is basically just on the .Died event
and i can confirm the problem is that triggering
i havent done any other debugging other than that, since im not quite sure what else there is to debug
also this didnt work
is the .Died running itself
and again, humanoid is still present
no like is it js not running
its not running in this specific scenario
every other scenario works
other explosions, resetting, hitboxes
all those works
just this scenario
im sure this is the problem
btw man u dont need to loop through the rig to find humanoid
could just do WaitForChild
i was going to loop through it anyways
mk
cuz i was going for a hyperlaser hit effect yknow
so mind as well (i've changed it to :waitforchild() as par to @oak skiff 's suggestion anyways)
aight calm
set dead to true and remove the return end js for debug rq
or just add a warn to it
commented them out
actually
the .Died might be running after ts dead
so set dead to true if its alr dead
yeah that was why i added that
no like if
hum.Health <= 0 then dead = true end
huh
and if its that fails then trigger the humanoid.died
what do i do that on a run service?
gimme a sec
honestly using run service might be smart
yh i guess
when you use wait for child and get the humanoid is it actually killing it when you set its health to 0?
wdym
like this part
does that actually kill the player
if hum.Health == 0 then
dead = true
else
print("alr dead vro")
yeah
imma plug this on a rs for testing
calm
how did you format your text like that
do you need some sort of extension to do that
oh
huh
before the .Died function
on the character added event.?
yh
if hum.Health <= 0 then
print("alr dead")
wait mb use this
or getchangedpropertysignal?
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character.AttributeChanged:Connect(function(name)
print(name)
end)
end)
end)
local hit = workspace -- replace
for _, char : Model in hit:GetChildren() do
if char:IsA("Model") and char:FindFirstChildOfClass("Humanoid") then
char:FindFirstChildOfClass("Humanoid").Health = 0
char:SetAttribute("Dead", true)
end
end
yea sure
print its hp btw
if hp<=0 then
print("is dead twin")
sick it works
hold on though
should i get a .Died event
just in case the player dies from something other than health
like neck gone or something
yh
if youre going to destroy its neck and interpret it as the player being killed you might as well set the health to 0 after destroying the neck
js check what killed the player
also any idea on whats going on with scenario B?
theres a scenario B
scenario B:
i've checked with script finder (keyword : :Destroy()) and nothing showed up
they're GONE
only the limbs
humanoid, starter character scripts, they're all there
check for debris service
Bro what?
hmmmm
what about setting the parent to nil
** You are now Level 2! **
uh?
lemme keep testing hold on, cuz after i changed the health property the scneario b seems to not be showing up anymore
ok scenario b seems to just be gone now??
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character.DescendantRemoving:Connect(function(descendant)
-- check to see what is being removed
end)
end)
end)
yippee
well i guess im not complaining
imma set up the .Died now
prayign it wont break everything somehow
aight nice
alright everything seems to be working fine
thx so much man this has caused alot of confusion
np
if u don’t mind explain how u fixed it
essentially having an extra healthchanged event
** You are now Level 15! **
the health was changing but the death aint workin
so that works
i doubt you'd encounter a similair situation though
Use humanoid:TakeDamage(amountOfDamage: number) instead of setting it manually
that already is a thing in the explosion script
module script*
You need to re-assign the humanoid and the connection
uhm the problem was already solved yesterday..
Oh
and it gets reassigned every time the player respawns
Mark it as solved then