Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Author: Zyos
- Date: 7/8/2025 MM/DD/YY
- Description: Practice Clientside
- Uses: data_, CFrames
- ]]
- --Services
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local Players = game:GetService("Players")
- --Modules
- local main = script.Parent
- local CFrames = require(main:WaitForChild("CFrames"))
- --Variables
- local player = Players.LocalPlayer
- local RSpractice = ReplicatedStorage:WaitForChild("ZyosAddons"):WaitForChild("practice")
- local NoclipTool = RSpractice:WaitForChild("Noclip")
- local cPart = RSpractice:WaitForChild("cPart")
- local highlight = RSpractice:WaitForChild("highlight")
- local cFolder = workspace:WaitForChild("ZyosAddons"):WaitForChild("practice"):WaitForChild("checkpoints")
- --XXX--
- local practice = {}
- function practice:toggle()
- local enabled = player.practice["enabled [C]"]
- if enabled.Value then
- self:disable(player)
- enabled.Value = false
- else
- self:enable(player)
- enabled.Value = true
- end
- end
- function practice:enable()
- local clone = NoclipTool:Clone()
- clone.Parent = player.Backpack
- local hClone = highlight:Clone()
- hClone.Parent = player.Character
- end
- function practice:disable()
- local backpack = player.Backpack
- local character = player.Character
- if backpack:FindFirstChild("Noclip") then backpack.Noclip:Destroy() end
- if character:FindFirstChild("Noclip") then character.Noclip:Destroy() end
- if character:FindFirstChild("highlight") then character.highlight:Destroy() end
- self:disableNoclip()
- self:clearCheckpoints()
- end
- function practice:disableNoclip()
- local char = player.Character
- local humanoid = char:WaitForChild("Humanoid")
- local root = char:WaitForChild("HumanoidRootPart")
- root.Anchored = false
- root.Velocity = Vector3.new()
- humanoid.PlatformStand = false
- end
- function practice:clearCheckpoints()
- for i,v in cFolder:GetChildren() do
- v:Destroy()
- end
- end
- function practice:spawn()
- local torso = player.Character:WaitForChild("HumanoidRootPart")
- local clone = cPart:Clone()
- clone.Name = #cFolder:GetChildren() + 1
- clone.CFrame = torso.CFrame
- clone.Parent = cFolder
- CFrames:set(clone.CFrame)
- end
- function practice:delete()
- local last = self:_findLast()
- if not last then return end
- last:Destroy()
- local last2nd = self:_findLast()
- if last2nd then CFrames:set(last2nd.CFrame) return end
- CFrames:set(CFrame.new())
- end
- function practice:_findLast()
- local maxNumber = 0
- local last
- for _, part in ipairs(cFolder:GetChildren()) do
- if part:IsA("BasePart") then
- local number = tonumber(part.Name)
- if number and number > maxNumber then
- maxNumber = number
- last = part
- end
- end
- end
- return last
- end
- return practice
Advertisement
Add Comment
Please, Sign In to add comment