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.
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
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
repeat wait() until char.Humanoid
local humanoid = char.Humanoid
local function died()
local hint = Instance.new("Hint")
hint.Parent = game.Workspace
hint.Text = plr.Name.." has died!"
wait(5)
hint:destroy()
end
humanoid.Died:connect(died)
end)
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
thank you again gulliblechap, i think i can learn some more lua on my own, im working on learning if statements!
once again freezy, its no problem