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
|
  |
| 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
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
| |
|
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
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 15 May 2016 03:42 PM |
just handle it on the server
|
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
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
|
  |
| 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
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 15 May 2016 03:53 PM |
Oh, alright I will give it a shot.
|
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 15 May 2016 04:30 PM |
| What are you talking about? RemoteAnything have latency. |
|
|
| Report Abuse |
|
|
|
| 15 May 2016 04:32 PM |
"What are you talking about? RemoteAnything have latency."
False. Misconception. Not true.
|
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 15 May 2016 04:42 PM |
RemoteFunctions are RemoteEvents that can return values and yields, that's all.
|
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|