Kotyara19k-Official

John Slime

Apr 1st, 2025
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local char = player.Character
  3. local rootPart = char and char:FindFirstChild("HumanoidRootPart")
  4.  
  5. local tool
  6. for i, v in player:GetDescendants() do
  7. if v.Name == "SyncAPI" then
  8. tool = v.Parent
  9. end
  10. end
  11. for i, v in game.ReplicatedStorage:GetDescendants() do
  12. if v.Name == "SyncAPI" then
  13. tool = v.Parent
  14. end
  15. end
  16.  
  17. remote = tool.SyncAPI.ServerEndpoint
  18. function _(args) remote:InvokeServer(unpack(args)) end
  19.  
  20. function ApplyChanges(part, size, color, material)
  21. if not part then return end
  22.  
  23. for i = 1, 3 do -- Повторяем 3 раза для надежности
  24. task.wait(0.1)
  25.  
  26. local argsResize = {
  27. [1] = "SyncResize",
  28. [2] = {
  29. [1] = {
  30. ["Part"] = part,
  31. ["CFrame"] = part.CFrame,
  32. ["Size"] = size
  33. }
  34. }
  35. }
  36. _(argsResize)
  37.  
  38. local argsColor = {
  39. [1] = "SyncColor",
  40. [2] = {
  41. [1] = {
  42. ["Part"] = part,
  43. ["Color"] = color,
  44. ["UnionColoring"] = false
  45. }
  46. }
  47. }
  48. _(argsColor)
  49.  
  50. local argsMaterial = {
  51. [1] = "SyncMaterial",
  52. [2] = {
  53. [1] = {
  54. ["Part"] = part,
  55. ["Material"] = material
  56. }
  57. }
  58. }
  59. _(argsMaterial)
  60. end
  61. end
  62.  
  63. function FindLastCreatedPart()
  64. task.wait(0.1) -- Даем время на создание
  65. local lastPart = nil
  66. for _, v in workspace:GetChildren() do
  67. if v:IsA("BasePart") and v.Parent == workspace then
  68. lastPart = v -- Берем последний найденный парт
  69. end
  70. end
  71. return lastPart
  72. end
  73.  
  74. function CreatePart(cf, size, color, material)
  75. local args = {
  76. [1] = "CreatePart",
  77. [2] = "Normal",
  78. [3] = cf,
  79. [4] = workspace
  80. }
  81. _(args)
  82.  
  83. task.wait(0.2) -- Ждем появления парта
  84.  
  85. local newPart = FindLastCreatedPart()
  86. if newPart then
  87. print("Создан парт:", newPart)
  88. ApplyChanges(newPart, size, color, material)
  89. return newPart
  90. else
  91. print("Ошибка: парт не найден после создания!")
  92. return nil
  93. end
  94. end
  95.  
  96. function DestroyPart(part)
  97. if part then
  98. local args = {
  99. [1] = "Remove",
  100. [2] = { [1] = part }
  101. }
  102. _(args)
  103. end
  104. end
  105.  
  106. local lastSlime
  107.  
  108. while true do
  109. task.wait(0.00000000000000000000000000001)
  110.  
  111. if rootPart then
  112. local newCF = rootPart.CFrame * CFrame.new(0, -3, 0)
  113. local newSlime = CreatePart(newCF, Vector3.new(8.2, 0.2, 8.2), Color3.fromRGB(0, 0, 0), "Foil")
  114.  
  115. if lastSlime then
  116. DestroyPart(lastSlime)
  117. end
  118.  
  119. lastSlime = newSlime
  120. end
  121. end
  122.  
Advertisement
Add Comment
Please, Sign In to add comment