Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ OPEN-SOURCE COMPANION ]]--
- local Main = {
- Settings = {
- Radius = 10,
- },
- Classes = {
- _CREATOR = game.Players.LocalPlayer.Name,
- _ORB = {
- Name = "Orb",
- Material = "Neon",
- }
- },
- Schemes = {},
- Commands = {Prefix = "/"},
- Connections = {},
- }
- function Main.new(_CLASS)
- local Returned do
- if _CLASS == "_ORB" then
- Returned = Instance.new("Part", game.Players.LocalPlayer.Character) do
- Returned.Name = Main.Classes[_CLASS].Name
- Returned.FormFactor = "Custom"
- Returned.Size = Vector3.new(1.4, 1.4, 1.4)
- Returned.TopSurface = "Smooth"
- Returned.BottomSurface = "Smooth"
- Returned.Anchored = true
- Returned.CanCollide = false
- Returned.Material = Main.Classes[_CLASS].Material
- Instance.new("SpecialMesh", Returned).MeshType = "Sphere"
- end
- end
- end
- return Returned
- end
- function Main:AddScheme(Name, Scheme)
- local Name = string.lower(Name)
- if not self.Schemes[Name] then
- self.Schemes[Name] = Scheme
- end
- return self.Schemes[Name]
- end
- function Main:AddCommand(Name, Function)
- local Name = string.lower(Name)
- if not self.Commands[Name] then
- self.Commands[Name] = Function
- end
- end
- function Main:GenerateParticle(Index)
- local InitialSize = Vector3.new(0.7, 0.7, 0.7)
- local FinalSize = InitialSize * 10
- local Color = self.Schemes.Current[math.floor(math.deg(Index)) % #self.Schemes.Current + 1]
- local Particle = Instance.new("Part", self.Orb)
- Particle.Material = self.Orb.Material
- Particle.BrickColor = Color
- Particle.Anchored = true
- Particle.CanCollide = false
- Particle.FormFactor = "Custom"
- Particle.TopSurface = "Smooth"
- Particle.BottomSurface = "Smooth"
- Particle.Size = InitialSize
- Particle.CFrame = self.Orb.CFrame
- Instance.new("SpecialMesh", Particle).MeshType = "Sphere"
- spawn(function()
- for Alpha = 0, 1, 1/30 do
- wait()
- Particle.Transparency = Alpha
- Particle.Size = InitialSize:Lerp(FinalSize, Alpha^4)
- end
- Particle:Destroy()
- end)
- end
- function Main:BindOrbit(Key)
- self.Connections[Key] = true
- local Index = 0
- while self.Connections[Key] do
- wait()
- Index = Index + math.rad(5)
- if not self.Orb then
- self.Orb = self.new("_ORB")
- end
- self.Orb.CFrame = self.Orb.CFrame:lerp(game.Players.LocalPlayer.Character.Head.CFrame
- * CFrame.Angles(math.sin(tick())/4, math.sin(tick())/4, math.sin(tick())/4)
- * CFrame.new(self.Settings.Radius*math.sin(Index), 0, self.Settings.Radius*math.cos(Index)), 0.075)
- self.Orb.BrickColor = self.Schemes.Current.OrbColor
- self:GenerateParticle(Index)
- end
- end
- function Main:UnbindOrbit(Key)
- self.Connections[Key] = false
- end
- game.Players.LocalPlayer.Chatted:connect(function(Message)
- if string.match(Message, "^" .. Main.Commands.Prefix) then
- local Command = string.match(Message, "%w+")
- if Command and Main.Commands[string.lower(Command)] then
- local _, StringEnd = string.find(Message, Command)
- Main.Commands[string.lower(Command)](string.sub(Message, StringEnd + 2))
- end
- end
- end)
- do
- Main.Orb = Main.new("_ORB")
- end
- do
- Main.Schemes.Current = Main:AddScheme("Frostbite", {
- BrickColor.Blue(),
- OrbColor = BrickColor.new("Pastel blue"),
- })
- end
- do
- Main:AddCommand("Output", function(Message)
- print(Message)
- end)
- end
- Main:BindOrbit("_ORB-Bind")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement