Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait();
- script.Parent = nil
- do
- local LocalPlayer = game:GetService("Players").LocalPlayer
- local Utils do
- Utils = {
- Create = function(self, Typename, Props)
- local Inst = {ypcall(Instance.new, Typename)}
- if Inst and Inst[2] then
- Inst = Inst[2]
- if Props and type(Props) == "table" then
- for _, prop in next, Props do
- Inst[_] = prop
- end
- elseif type(Props) == "userdata" then
- Inst.Parent = Props
- end
- return Inst
- else
- return assert(false, ("Unable to create instance of type %q"):format(Typename))
- end
- end,
- ColorPart = function(self, Inst, Seed)
- if Inst and Inst:IsA("BasePart") then
- local RGB = {}
- local Section = (tick() + Seed) % 1 * 3
- local Secondary = 0.5 * math.pi * (Section % 1)
- if Section < 1 then
- RGB = {
- 1,
- 1 - math.cos(Secondary),
- 1 - math.sin(Secondary)
- }
- elseif Section < 2 then
- RGB = {
- 1 - math.sin(Secondary),
- 1,
- 1 - math.cos(Secondary)
- }
- else
- RGB = {
- 1 - math.cos(Secondary),
- 1 - math.sin(Secondary),
- 1
- }
- end
- local Handle = Inst:findFirstChild("BXHandleAdorn")
- if not Handle or Handle.ClassName ~= "BoxHandleAdornment" then
- ypcall(function() Handle:Destroy() end)
- Handle = self:Create("BoxHandleAdornment", {
- Parent = Inst,
- Visible = true,
- Transparency = 0,
- Size = Inst.Size + Vector3.new(0.01,0.01,0.01),
- AlwaysOnTop = false,
- ZIndex = 1,
- Name = "BXHandleAdorn",
- Adornee = Inst
- })
- end
- Handle.Color3 = Color3.new(unpack(RGB))
- end
- end,
- Slerp = function(self, a, b, c)
- return (1 - c) * a + (c * b)
- end,
- Clerp = function(self, start, destination,increment)
- local c1 = {start.X, start.Y, start.Z, start:toEulerAnglesXYZ()}
- local c2 = {destination.X, destination.Y, destination.Z, destination:toEulerAnglesXYZ()}
- for i,v in next, c1 do
- c1[i] = self:Slerp(v, c2[i], increment)
- end
- return CFrame.new(c1[1],c1[2],c1[3]) * CFrame.Angles(c1[4],c1[5],c1[6])
- end
- }
- end
- do
- repeat coroutine.yield() until LocalPlayer.Character
- local Reset
- local Parts do
- Reset = function()
- Parts = {}
- local Model = Utils:Create("Model", {
- Name = "Magik.",
- Parent = LocalPlayer.Character
- })
- for i = 1, 10 do
- local Part = Utils:Create("Part", {
- Name = "Magical Part",
- Parent = Model,
- FormFactor = "Custom",
- Size = Vector3.new(1, 0.5, 0.05),
- TopSurface = "Smooth",
- BottomSurface = "Smooth",
- Anchored = true,
- CanCollide = false
- })
- table.insert(Parts, Part)
- end
- end
- Reset()
- end
- LocalPlayer.CharacterAdded:connect(function(char)
- ypcall(function() Reset() end)
- end)
- local CurrentMovement, MovementIncrease = 0, 0.001
- local RadiusIncrease = 0
- local YAxis = 2
- local MaxYAxis = YAxis * 2
- while true do
- if not LocalPlayer.Character or LocalPlayer.Character.Parent ~= workspace then
- -- todo: make it continue (LUA IMPLEMENT CONTINUE INTO 5.1 THANKS)
- else
- local Torso = LocalPlayer.Character:findFirstChild("Torso")
- if Torso and Torso:IsA("BasePart") then
- local Amount = #Parts
- for i, Part in next, Parts do
- local OCF = Part.CFrame
- local NCF = CFrame.new(Torso.Position)
- * CFrame.Angles(0, ((((math.pi*2)/Amount)*i)+CurrentMovement), 0)
- * CFrame.new(0, YAxis, 0.5+(-((#Parts*.4)+RadiusIncrease))*math.sin(YAxis))
- Part.CFrame = NCF --Utils:Clerp(OCF, NCF, 0.85)
- Utils:ColorPart(Part, (0.5/(#Parts/i)))
- end
- CurrentMovement = CurrentMovement + MovementIncrease
- YAxis = math.sin(tick())*(MaxYAxis / 2)
- end
- end
- coroutine.yield()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement