generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Humanoid.Died only working once on Client?

Previous Thread :: Next Thread 
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
15 May 2016 03:30 PM
local player = game.Players.LocalPlayer
local Character = player.Character or player.CharacterAdded:wait()
local Humanoid = Character:WaitForChild("Humanoid")

Humanoid.Died:connect(function()
print(player.Name .. ' has died')
end)

Only prints it the first time...


Report Abuse
AuroJosh is not online. AuroJosh
Joined: 04 Oct 2015
Total Posts: 484
15 May 2016 03:32 PM
Does it get into the players stuff everytime? (Like playergui)


Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
15 May 2016 03:35 PM
Yes it's in StarterPack


Report Abuse
yankana is not online. yankana
Joined: 17 Jun 2011
Total Posts: 431
15 May 2016 03:40 PM
That's because local Character and all the other stuff are already set to one part, when the player respawns, a new character gets inserted and local Character isn't function anymore. Another thing is that the script only runs once, there's no loop in it. Here's how to do it:

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
char:WaitForChild("Humanoid").Died:connect(function()
print(player.Name.." just died.")
end)
end)
end)
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
15 May 2016 03:42 PM
just handle it on the server


Report Abuse
yankana is not online. yankana
Joined: 17 Jun 2011
Total Posts: 431
15 May 2016 03:42 PM
^ btw doesn't need to be put into local script, just put in workspace or wherever you want.
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
15 May 2016 03:48 PM
I'm trying to make a blur death effect with the new BlurEffect and ColorCorrection.
And I need to put the BlurEffect and ColorCorrection in CurrentCamera (only visible by localscript)


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
15 May 2016 03:49 PM
use a remote event


Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
15 May 2016 03:50 PM
But then It's gonna be delayed won't it?


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
15 May 2016 03:52 PM
not with remote events. that would happen only with remote functions


Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
15 May 2016 03:53 PM
Oh, alright I will give it a shot.


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
15 May 2016 03:54 PM
i put this in a local script and it was working for me

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:wait()
local human = char.Humanoid

human.Died:connect(function()
print("Died")
end)


Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
15 May 2016 04:26 PM
It works in Solo but not in Test Server. Only works once in Test Server.
Also the Remote Worked.


Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
15 May 2016 04:30 PM
What are you talking about? RemoteAnything have latency.
Report Abuse
GetTheJobDone is not online. GetTheJobDone
Joined: 20 Apr 2016
Total Posts: 3008
15 May 2016 04:32 PM
"What are you talking about? RemoteAnything have latency."

False. Misconception. Not true.


Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
15 May 2016 04:34 PM
Yes, they do.
Report Abuse
GetTheJobDone is not online. GetTheJobDone
Joined: 20 Apr 2016
Total Posts: 3008
15 May 2016 04:35 PM
No. RemoteEvents don't yield, and RemoteFunctions do, that's the only "delay". Other than that, let me explain it to you because you're plain wrong. Let's pretend REs and RFs are only in use with FilteringEnabled, which is mostly true.

How does a game work without FilteringEnabled? Client - > server -> other clients

How does a game work with FilteringEnabled? Client -> server -> other clients

You need to "hide" the lag because it's there no matter what.


Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
15 May 2016 04:38 PM
http://wiki.roblox.com/index.php?title=Fighting_Lag

Why would you even want to detect it on the server for this?
Report Abuse
GetTheJobDone is not online. GetTheJobDone
Joined: 20 Apr 2016
Total Posts: 3008
15 May 2016 04:40 PM
The only real "lag" you can say filtering causes is the packet type checking or whatever that's supposed to be called, which is for the most part to my knowledge unnoticeable. Other than that, again, same as without FE.


Report Abuse
12103net is not online. 12103net
Joined: 08 Jul 2013
Total Posts: 350
15 May 2016 04:40 PM
@getthe with remotefuncs isn't it

client->server->client->server->others
Report Abuse
GetTheJobDone is not online. GetTheJobDone
Joined: 20 Apr 2016
Total Posts: 3008
15 May 2016 04:42 PM
RemoteFunctions are RemoteEvents that can return values and yields, that's all.


Report Abuse
Isostae is not online. Isostae
Joined: 14 Sep 2014
Total Posts: 17706
15 May 2016 04:45 PM
The only difference between filteringenabled and not is that you have to script the replication. There's no more or less lag...


the power of the meme ( ͡° ͜ʖ ͡°)
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
15 May 2016 04:45 PM
uhh hi everyone
Report Abuse
GetTheJobDone is not online. GetTheJobDone
Joined: 20 Apr 2016
Total Posts: 3008
15 May 2016 04:46 PM
The "FilteringEnabled causes lag" misconception is annoying, and I thought we've mostly matured past that, along with the "you're an idiot if you don't use next instead of pairs" and so on and so forth.

Apparently, not totally.

Anyone got a link to cntkillme's myths thread? Would appreciate it.


Report Abuse
IlluminatiCat is not online. IlluminatiCat
Joined: 21 Feb 2009
Total Posts: 1216
15 May 2016 04:48 PM
Once the Humanoid dies, the Character resets and a different Humanoid is inserted into character.

yankana already provided code
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image