Advertisement
Hasli4

RBLX. KingOfTheHill

May 14th, 2025
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.78 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2.  
  3. local Hill = script.Parent
  4. local Label = Hill.BillboardGui.TextLabel
  5. local king_name = Hill.KingName
  6. local fall_distance = Hill.Size.Magnitude
  7. print("fall_distance:", fall_distance)
  8. local kingdown = true
  9. local position1 = Hill.Position
  10.  
  11. local function onTouch(part)
  12.     if (kingdown) then
  13.         kingdown = false
  14.         king_name.Value = part.Parent.Name
  15.         Label.Text = "Да здравствует король "..king_name.Value.."!"
  16.         local KING = part.Parent.Humanoid
  17.         local player = Players:GetPlayerFromCharacter(part.Parent)
  18.         local leaderstats = player.leaderstats
  19.         local crowns = leaderstats and
  20.                        leaderstats:FindFirstChild("Crowns")
  21.    local tool_to_destroy = player.Backpack:FindFirstChild("Tool")
  22.    if tool_to_destroy then
  23.       tool_to_destroy:Destroy()
  24.    end
  25.    tool_to_destroy = KING.Parent:FindFirstChild("Tool")
  26.    if tool_to_destroy then
  27.       tool_to_destroy:Destroy()
  28.    end
  29.  
  30.    while true do
  31.       wait(1)
  32.       KING.BodyDepthScale.Value += 0.06
  33.       KING.HeadScale.Value += 0.04
  34.       KING.BodyWidthScale.Value += 0.04
  35.       KING.BodyHeightScale.Value += 0.01
  36.       KING.WalkSpeed *=0.99
  37.       crowns.Value += 1
  38.       local position2 = part.Position  
  39.       local distance = (position1 - position2).magnitude
  40. local position2 = part.Position
  41. local distance = (position1 - position2).magnitude
  42. if distance > fall_distance then
  43.     king_name.Value = ""
  44.     Label.Text = "Король пал!"
  45.     KING.BodyDepthScale.Value = 1
  46.     KING.HeadScale.Value = 1
  47.     KING.BodyWidthScale.Value = 1
  48.     KING.BodyHeightScale.Value = 1
  49.     KING.WalkSpeed = 16
  50.     kingdown = true
  51.     local return_tool = game.ReplicatedStorage.Tool:Clone()
  52.     return_tool.Parent = KING.Parent
  53.     break
  54. end
  55.  
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement