Advertisement
ProScripter29

ROBLOX The Lost Lands Vitals Script

Jun 21st, 2023 (edited)
25,187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. -- :: --
  2. local Player = game:GetService("Players").LocalPlayer
  3. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  4. local Events = ReplicatedStorage:WaitForChild("Events")
  5.  
  6. -- :: --
  7. local Vitals = Player:WaitForChild("PlayerData"):WaitForChild("Vitals") -- Used for automatic vital healing
  8. local Consume = Events:WaitForChild("Consume")
  9. -- :: --
  10.  
  11. task.spawn(function()
  12. while task.wait() do
  13. if Player and Player.Character then
  14. Player.Character:WaitForChild("Humanoid").WalkSpeed = 38
  15. Player.Character:WaitForChild("Humanoid").JumpPower = 90
  16. local Percent = (Player.Character:WaitForChild("Humanoid").Health / Player.Character:WaitForChild("Humanoid").MaxHealth)
  17. if Percent <= 0.5 then
  18. Consume:FireServer("Health Potion")
  19. task.wait(0.5)
  20. end
  21. end
  22. end
  23. end)
  24.  
  25. Vitals:WaitForChild("Hunger").Changed:Connect(function()
  26. if Vitals.Hunger.Value <= 40 then
  27. repeat
  28. Consume:FireServer("Cooked Meat")
  29. task.wait(0.5)
  30. until Vitals.Hunger.Value >= 100
  31. end
  32. end)
  33.  
  34. Vitals:WaitForChild("Thirst").Changed:Connect(function()
  35. if Vitals.Thirst.Value <= 40 then
  36. repeat
  37. Consume:FireServer("Water")
  38. task.wait(0.5)
  39. until Vitals.Thirst.Value >= 100
  40. end
  41. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement