im still a new sceripter so i need some help, the scripting forum just makes fun of me so i come here.
i want a hint message to pop up for 5 seconds when a player dies.
Hello, I see you are asking about the .Died function.
Here is an example of what you are looking for:
IN A SERVER SCRIPT
01 | game.Players.PlayerAdded:connect( function (plr) |
02 | plr.CharacterAdded:connect( function (char) |
03 | repeat wait() until char.Humanoid |
04 | local humanoid = char.Humanoid |
05 |
06 | local function died() |
07 | local hint = Instance.new( "Hint" ) |
08 | hint.Parent = game.Workspace |
09 | hint.Text = plr.Name.. " has died!" |
10 | wait( 5 ) |
11 | hint:destroy() |
12 | end |
13 |
14 | humanoid.Died:connect(died) |
15 | end ) |
16 | end ) |
Here is what we used:
http://wiki.roblox.com/index.php?title=API:Class/Player/CharacterAdded http://wiki.roblox.com/index.php?title=API:Class/Humanoid/Died
Local functions are basically functions inside functions, which is what the died function is.