I Have This Regenaration Code For My Zomibes(Humanoid) And Towards The End Of The Code I Need It To Give The Person Who Slays The Zombie A Certain Amount Of Points(Leaderboard Values)
But I Just Cant Figure It Out!
local Save = script.Parent:Clone() Save.Parent = game.ServerStorage local regenTime = 60 local messageTime = 2.5 local model = script.Parent local message = Instance.new("Message") function IsDead() if model.Humanoid.Health <= 0 then return true else return false end end while true do if IsDead() then message.Parent = game.Workspace wait(1) message.Parent = nil wait(1) -- respawn the dead character local GetBackup = Save:Clone() GetBackup.Parent = game.Workspace break -- braking the loop end wait(0) end model.Parent = nil
Anyone Have Any Solutions? Because I'm Kinda New To Lua.
The died event sees if a humanoid's health depletes to 0, as seen in this script!
workspace.LordDragonZord.Humanoid.Died:connect(function() print("Oh no! LordDragonZord Died!") end)
MakeJoints is a function that sees if a player has any welds and connects parts together. Use this so the body doesn't break
workspace.Zombie:MakeJoints()
http://wiki.roblox.com/index.php?title=Leaderboard
http://wiki.roblox.com/index.php?title=Tools#Damage
local zombie = workspace.Zombie local h = zombie:FindFirstChild("Monster") --Or humanoid local clone = zombie:clone() if h then h.Died:connect(function() wait(60) --1 minute clone.Parent = workspace clone:MakeJoints() end) end
This script isn't a good script, it isn't finished either! You need to use what you learned to make a finished script! (Add the leaderstat point rewarder!)
Hope this helps! !LordDragonZord
Closed as Not Constructive by Goulstem and evaera
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?