Guest User

practice

a guest
Jul 15th, 2025
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. --[[
  2. Author: Zyos
  3. Date: 7/8/2025 MM/DD/YY
  4. Description: Practice Clientside
  5. Uses: data_, CFrames
  6. ]]
  7.  
  8. --Services
  9. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  10. local Players = game:GetService("Players")
  11.  
  12. --Modules
  13. local main = script.Parent
  14.  
  15. local CFrames = require(main:WaitForChild("CFrames"))
  16.  
  17. --Variables
  18. local player = Players.LocalPlayer
  19.  
  20. local RSpractice = ReplicatedStorage:WaitForChild("ZyosAddons"):WaitForChild("practice")
  21. local NoclipTool = RSpractice:WaitForChild("Noclip")
  22. local cPart = RSpractice:WaitForChild("cPart")
  23. local highlight = RSpractice:WaitForChild("highlight")
  24.  
  25. local cFolder = workspace:WaitForChild("ZyosAddons"):WaitForChild("practice"):WaitForChild("checkpoints")
  26.  
  27. --XXX--
  28.  
  29. local practice = {}
  30.  
  31. function practice:toggle()
  32. local enabled = player.practice["enabled [C]"]
  33.  
  34. if enabled.Value then
  35. self:disable(player)
  36. enabled.Value = false
  37. else
  38. self:enable(player)
  39. enabled.Value = true
  40. end
  41. end
  42.  
  43. function practice:enable()
  44. local clone = NoclipTool:Clone()
  45. clone.Parent = player.Backpack
  46.  
  47. local hClone = highlight:Clone()
  48. hClone.Parent = player.Character
  49. end
  50.  
  51. function practice:disable()
  52. local backpack = player.Backpack
  53. local character = player.Character
  54.  
  55. if backpack:FindFirstChild("Noclip") then backpack.Noclip:Destroy() end
  56. if character:FindFirstChild("Noclip") then character.Noclip:Destroy() end
  57.  
  58. if character:FindFirstChild("highlight") then character.highlight:Destroy() end
  59.  
  60. self:disableNoclip()
  61. self:clearCheckpoints()
  62. end
  63.  
  64. function practice:disableNoclip()
  65. local char = player.Character
  66. local humanoid = char:WaitForChild("Humanoid")
  67. local root = char:WaitForChild("HumanoidRootPart")
  68.  
  69. root.Anchored = false
  70. root.Velocity = Vector3.new()
  71. humanoid.PlatformStand = false
  72. end
  73.  
  74. function practice:clearCheckpoints()
  75. for i,v in cFolder:GetChildren() do
  76. v:Destroy()
  77. end
  78. end
  79.  
  80. function practice:spawn()
  81. local torso = player.Character:WaitForChild("HumanoidRootPart")
  82.  
  83. local clone = cPart:Clone()
  84. clone.Name = #cFolder:GetChildren() + 1
  85. clone.CFrame = torso.CFrame
  86. clone.Parent = cFolder
  87.  
  88. CFrames:set(clone.CFrame)
  89. end
  90.  
  91.  
  92. function practice:delete()
  93. local last = self:_findLast()
  94. if not last then return end
  95.  
  96. last:Destroy()
  97.  
  98. local last2nd = self:_findLast()
  99. if last2nd then CFrames:set(last2nd.CFrame) return end
  100.  
  101. CFrames:set(CFrame.new())
  102. end
  103.  
  104. function practice:_findLast()
  105. local maxNumber = 0
  106. local last
  107.  
  108. for _, part in ipairs(cFolder:GetChildren()) do
  109. if part:IsA("BasePart") then
  110. local number = tonumber(part.Name)
  111. if number and number > maxNumber then
  112. maxNumber = number
  113. last = part
  114. end
  115. end
  116. end
  117.  
  118. return last
  119. end
  120.  
  121. return practice
  122.  
Advertisement
Add Comment
Please, Sign In to add comment