Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---< Cubix Beta >---
- -- By KnightOfChess --
- local plr = game.Players.LocalPlayer
- local char = plr.Character
- local mouse = plr:GetMouse()
- local render = game:GetService("RunService").RenderStepped
- local version = 1.3
- ---
- defaultText = (char.Name.."'s Cubix")
- local coolDown = false
- local box = Instance.new("Part",workspace)
- local fire = Instance.new("Fire",box)
- local slc = Instance.new("SelectionBox",box)
- local gui = Instance.new("BillboardGui",box)
- local txt = Instance.new("TextLabel",gui)
- local light = Instance.new("PointLight",box)
- local pew = Instance.new("Sound",box)
- local hitmarker = Instance.new("Part",workspace)
- local hitmsh = Instance.new("SpecialMesh",hitmarker)
- hitmsh.MeshId = "http://www.roblox.com/asset/?id=3270017"
- hitmarker.Anchored = true
- hitmarker.Transparency = .5
- hitmarker.CFrame = mouse.Hit
- box.Name = "Cubix"
- hitmsh.Scale = Vector3.new(4,4,.01)
- hitmarker.CanCollide = false
- local hit = false
- local isHitting = false
- local lastcmd = "kill"
- pew.SoundId = "http://www.roblox.com/asset/?id=11944350"
- light.Range = 12
- light.Brightness = 5
- gui.StudsOffset = Vector3.new(0,3,0)
- txt.Name = "Cubix"
- txt.BackgroundTransparency = 1
- txt.FontSize = "Size24"
- gui.AlwaysOnTop = true
- gui.Size = UDim2.new(0,200,0,50)
- txt.Size = UDim2.new(0,200,0,50)
- txt.Text = defaultText
- txt.Font = "SourceSansBold"
- txt.TextStrokeTransparency = 0.5
- slc.Adornee = box
- slc.Color3 = Color3.fromRGB(0,0,0)
- slc.LineThickness = 0.02
- slc.Transparency = .5
- slc.SurfaceTransparency = 0
- local txt2 = txt:Clone()
- txt2.Parent = gui
- txt2.Position = UDim2.new(0,0,0,18)
- txt2.Text = "- Created by KnightOfChess and safiknaufal45 -"
- txt2.FontSize = "Size14"
- txt2.TextStrokeTransparency = .5
- txt2.TextColor3 = Color3.fromRGB(255,255,255)
- local pos = Instance.new("BodyPosition",box)
- local apos = Instance.new("BodyAngularVelocity",box)
- apos.AngularVelocity = Vector3.new(0,0,0)
- pos.P = 20000
- box.Size = Vector3.new(2.25,2.25,2.25)
- box.Transparency = .99
- fire.Heat = -7
- fire.Size = 8
- local box2 = box:Clone()
- box2.Parent = workspace
- box2.Fire:Destroy()
- box2.BillboardGui:Destroy()
- box2.BodyPosition:Destroy()
- box2.PointLight:Destroy()
- box2.BodyAngularVelocity:Destroy()
- box2.CanCollide = false
- box2.SelectionBox.SurfaceTransparency = 0.6
- local physicalProperties = PhysicalProperties.new(.01,.3,.5,1,1)
- box2.CustomPhysicalProperties = physicalProperties
- box.CustomPhysicalProperties = physicalProperties
- box2.CFrame = box.CFrame
- box2.Size = Vector3.new(2.6,2.6,2.6)
- box2.SelectionBox.Transparency = 1
- local weld = Instance.new("ManualWeld",box)
- weld.Part0 = box
- weld.Part1 = box2
- weld.C0 = box.CFrame:inverse() * box2.CFrame
- mouse.Button1Down:connect(function()
- if box~=nil then
- pew:Play()
- isHitting = true
- local ray = Ray.new(box.CFrame.p, (mouse.Hit.p - box.CFrame.p).unit * 300)
- local part, position = workspace:FindPartOnRay(ray, char, false, true)
- local beam = box:Clone()
- local ring = Instance.new("Part", workspace)
- local msh = Instance.new("SpecialMesh",ring)
- local explode = Instance.new("Part",workspace)
- local smesh = Instance.new("SpecialMesh",explode)
- smesh.MeshType = "Sphere"
- explode.Anchored = true
- explode.CanCollide = false
- explode.Size = Vector3.new(1,1,1)
- explode.TopSurface = "Smooth"
- explode.BottomSurface = "Smooth"
- msh.MeshId = "http://www.roblox.com/asset/?id=3270017"
- ring.Size = Vector3.new(1,1,1)
- ring.Anchored = true
- ring.CanCollide = false
- ring.BrickColor = BrickColor.new("Mid gray")
- beam.Parent = workspace
- beam.Fire:Destroy()
- beam.BillboardGui:Destroy()
- beam.BodyPosition:Destroy()
- beam.PointLight:Destroy()
- beam.BodyAngularVelocity:Destroy()
- beam.CanCollide = false
- beam.Anchored = true
- beam.SelectionBox.Transparency = .5
- beam.SelectionBox.SurfaceTransparency = 1
- local distance = (box.CFrame.p - position).magnitude
- beam.Size = Vector3.new(.4, .4, distance)
- beam.CFrame = CFrame.new(box.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
- ring.CFrame = beam.CFrame:toWorldSpace(CFrame.new(0,0,distance/2-2))
- explode.CFrame = hitmarker.CFrame
- local fakemarker = hitmarker:Clone()
- fakemarker.Parent = workspace
- fakemarker.CFrame = hitmarker.CFrame
- coroutine.resume(coroutine.create(function()
- isHitting = false
- end))
- coroutine.resume(coroutine.create(function()
- for i = .4,2.5,.09 do
- local a = Instance.new("Part", workspace)
- a.Anchored = true
- a.Transparency = 1
- explode.Mesh.Scale = explode.Mesh.Scale + Vector3.new(i/2.5,i/2.5,i/2.5)
- explode.Transparency = i/2
- fakemarker.Mesh.Scale = fakemarker.Mesh.Scale + Vector3.new(.3,.3,0)
- fakemarker.Transparency = i-.4
- a.CFrame = ring.CFrame:toWorldSpace(CFrame.new(0,0,5))
- pos.Position = a.Position
- a:Destroy()
- ring.Transparency = ring.Transparency + .06
- msh.Scale = msh.Scale + Vector3.new(.3,.3,0)
- box2.SelectionBox.Color3 = Color3.fromRGB(r,g,b)
- beam.CFrame = CFrame.new(box.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
- beam.SelectionBox.Color3 = Color3.fromRGB(r,g,b)
- beam.SelectionBox.LineThickness = beam.SelectionBox.LineThickness + .03
- beam.SelectionBox.Transparency = beam.SelectionBox.Transparency + .03
- render:wait()
- end
- ring:Destroy()
- beam:Destroy()
- fakemarker:Destroy()
- explode:Destroy()
- end))
- beam.Touched:connect(function(p)
- if lastcmd == "kill" then
- local h = p.Parent:findFirstChild("Humanoid")
- if hit == false and h ~= nil and p.Parent~=char then
- p.Parent:BreakJoints()
- end
- elseif lastcmd == "explode" then
- local p = Instance.new("Part",workspace)
- p.Transparency = 1
- p.CFrame = beam.CFrame:toWorldSpace(CFrame.new(0,0,-distance/2))
- local ex = Instance.new("Explosion",workspace)
- ex.Position = p.Position
- p:Destroy()
- elseif lastcmd == "kick" then
- local h = p.Parent:findFirstChild("Humanoid")
- if hit == false and h ~= nil and p.Parent ~= char then
- local playr = game.Players:findFirstChild(p.Parent.Name)
- if playr ~= nil then
- playr:Destroy()
- end
- end
- elseif lastcmd == "ff" then
- local h = p.Parent:findFirstChild("Humanoid")
- if h~=nil then
- local ff = Instance.new("ForceField")
- ff.Parent = p.Parent
- end
- elseif lastcmd == "destroy" then
- coroutine.resume(coroutine.create(function()
- if p.Parent~=char and p~=box and p~=box2 and p.Name~="Baseplate" then
- for i = p.Transparency,1,.025 do
- p.Transparency = i
- render:wait()
- end
- p:Destroy()
- end
- end))
- elseif lastcmd == "damage" then
- local h = p.Parent:findFirstChild("Humanoid")
- if h~=nil and dmg and hit == false then
- h:TakeDamage(dmg)
- end
- elseif lastcmd == "fire" then
- local h = p.Parent:findFirstChild("Humanoid")
- if h~=nil and p.Parent~=char then
- local burn = Instance.new("Fire",p.Parent.Torso)
- coroutine.resume(coroutine.create(function()
- repeat render:wait()
- if burn.Size < 10 then
- burn.Size = burn.Size + .05
- end
- burn.Color = Color3.fromRGB(r,g,b)
- burn.SecondaryColor = burn.Color
- h:TakeDamage(.2)
- until h.Health <= 0
- burn:Destroy()
- end))
- end
- end
- end)
- end
- end)
- function TypeMsg(msg,obj)
- for i = 0,#msg do
- obj.Text = msg:sub(0,i)
- wait(.055)
- end
- end
- plr.Chatted:connect(function(msg)
- local msg2 = msg
- if msg2 == "/setbeam kill" or msg2 == "/sb kill" then
- lastcmd = "kill"
- msg2 = 'Beam set to "Kill".'
- txt2.Text = "- Kill Beam activated. -"
- TypeMsg(msg2,txt)
- end
- if msg2 == "/setbeam explode" or msg2 == "/sb explode" then
- lastcmd = "explode"
- msg2 = 'Beam set to "Explode".'
- txt2.Text = "- Explosive Beam activated. -"
- TypeMsg(msg2,txt)
- end
- if msg2 == "/setbeam kick" or msg2 == "/sb kick" then
- lastcmd = "kick"
- msg2 = '- Beam set to "Kick". -'
- txt2.Text = "- Kick Beam activated. -"
- TypeMsg(msg2,txt)
- end
- if msg2 == "/setbeam ff" or msg2 == "/sb ff" then
- lastcmd = "ff"
- msg2 = '- Beam set to "Forcefield" -'
- txt2.Text = "- Forcefield Beam activated. -"
- TypeMsg(msg2,txt)
- end
- if msg2 == "/setbeam destroy" or msg2 == "/sb destroy" then
- lastcmd = "destroy"
- msg2 = '- Beam set to "Destroy" -'
- txt2.Text = "- Destroy Beam activated. -"
- TypeMsg(msg2,txt)
- end
- if msg2:sub(1,13) == "/setbeam dmg " or msg2:sub(1,8) == "/sb dmg " then
- lastcmd = "damage"
- if #msg2>13 then
- dmg = msg2:sub(13,#msg2)
- else dmg = msg2:sub(8,#msg2)
- end
- msg2 = ('- Beam set to "Damage" '.."("..dmg.." )".." -")
- txt2.Text = "- Damage Beam activated -"
- TypeMsg(msg2,txt)
- end
- if msg2 == "/setbeam fire" or msg2 == "/sb fire" then
- lastcmd = "fire"
- msg2 = '- Beam set to "Fire" -'
- txt2.Text = "- Fire Beam activated -"
- TypeMsg(msg2,txt)
- end
- coroutine.resume(coroutine.create(function()
- local Effect = box:Clone()
- Effect.Parent = workspace
- Effect:ClearAllChildren()
- Effect.CFrame = box.CFrame
- Effect.Anchored = true
- Effect.CanCollide = false
- local ESlc = slc:Clone()
- ESlc.Parent = Effect
- for i = 2.5,3.5,.05 do
- ESlc.Adornee = Effect
- Effect.Size = Vector3.new(i,i,i)
- ESlc.SurfaceTransparency = ESlc.SurfaceTransparency + 0.065
- ESlc.Transparency = 1
- render:wait()
- end
- Effect:Destroy()
- end))
- if msg:sub(0,1)~="/" then
- for i = 0,#msg do
- txt.Text = ("- "..msg:sub(0,i).." -")
- wait(.055)
- end
- end
- wait(2)
- txt.Text = defaultText
- end)
- coroutine.resume(coroutine.create(function()
- repeat
- r = 255
- g = 0
- b = 0
- for i = 0,255,3 do
- r = r - 3
- b = b + 3
- slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
- box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
- fire.Color = Color3.fromRGB(r,g,b)
- fire.SecondaryColor = fire.Color
- txt.TextColor3 = Color3.fromRGB(r,g,b)
- light.Color = Color3.fromRGB(r,g,b)
- render:wait()
- end
- for i = 0,255,3 do
- g = g + 3
- slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
- box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
- fire.Color = Color3.fromRGB(r,g,b)
- fire.SecondaryColor = fire.Color
- txt.TextColor3 = Color3.fromRGB(r,g,b)
- light.Color = Color3.fromRGB(r,g,b)
- render:wait()
- end
- for i = 0,255,3 do
- b = b - 3
- slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
- box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
- fire.Color = Color3.fromRGB(r,g,b)
- fire.SecondaryColor = fire.Color
- txt.TextColor3 = Color3.fromRGB(r,g,b)
- light.Color = Color3.fromRGB(r,g,b)
- render:wait()
- end
- for i = 0,255,3 do
- r = r + 3
- slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
- box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
- fire.Color = Color3.fromRGB(r,g,b)
- fire.SecondaryColor = fire.Color
- txt.TextColor3 = Color3.fromRGB(r,g,b)
- light.Color = Color3.fromRGB(r,g,b)
- render:wait()
- end
- for i = 0,255,3 do
- g = g - 3
- slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
- box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
- fire.Color = Color3.fromRGB(r,g,b)
- fire.SecondaryColor = fire.Color
- txt.TextColor3 = Color3.fromRGB(r,g,b)
- light.Color = Color3.fromRGB(r,g,b)
- render:wait()
- end
- until false
- end))
- coroutine.resume(coroutine.create(function()
- repeat
- if isHitting == false then
- local x = Instance.new("Part",workspace)
- x.Transparency = 1
- x.CanCollide = false
- x.Anchored = true
- coroutine.resume(coroutine.create(function()
- repeat render:wait()
- x.CFrame = char.Torso.CFrame:toWorldSpace(CFrame.new(3,4,0))
- until false
- end))
- for i = 3,4,.005 do
- pos.Position = x.Position + Vector3.new(0,.01,0)
- render:wait()
- end
- for i = 4,3,-.005 do
- pos.Position = x.Position + Vector3.new(0,-.01,0)
- render:wait()
- end
- x:Destroy()
- end
- until false
- end))
- coroutine.resume(coroutine.create(function()
- repeat wait(.75)
- local boom = Instance.new("Part",workspace)
- local bmsh = Instance.new("SpecialMesh",boom)
- bmsh.MeshId = "http://www.roblox.com/asset/?id=20329976"
- boom.Size = Vector3.new(1,1,1)
- bmsh.Scale = Vector3.new(3,1,3)
- boom.Anchored = true
- boom.CanCollide = false
- boom.Position = Vector3.new(box.CFrame.x,0,box.CFrame.z)
- coroutine.resume(coroutine.create(function()
- for i = 1,2,.01 do
- boom.Position = Vector3.new(box.CFrame.x,.1,box.CFrame.z)
- boom.CFrame = boom.CFrame * CFrame.fromEulerAnglesXYZ(0,.15,0)
- boom.Transparency = i/1.8
- bmsh.Scale = bmsh.Scale + Vector3.new(i/25,-.01,i/25)
- render:wait()
- end
- boom:Destroy()
- end))
- until not char
- end))
- coroutine.resume(coroutine.create(function()
- local spin = 4
- repeat
- local num = math.random(spin*-1000,spin*1000)/1000
- for i = 0,num,.01 do
- apos.AngularVelocity = Vector3.new(i,i,i)
- render:wait()
- end
- for i = num,0,-.01 do
- apos.AngularVelocity = Vector3.new(i,i,i)
- render:wait()
- end
- until not char
- end))
- coroutine.resume(coroutine.create(function()
- repeat render:wait()
- slc.Adornee = box
- hitmarker.CFrame = CFrame.new(mouse.Hit.X,0,mouse.Hit.Z) * CFrame.fromEulerAnglesXYZ(-1.5708,0,0)
- until false
- end))
- coroutine.resume(coroutine.create(function()
- char.Humanoid.Died:connect(function()
- for i = 2.5,3.2,.025 do
- txt.TextTransparency = txt.Transparency + 0.075
- slc.SurfaceTransparency = slc.SurfaceTransparency + 0.075
- slc.Transparency = slc.Transparency + 0.075
- render:wait()
- end
- box:Destroy()
- box2:Destroy()
- end)
- end))
Add Comment
Please, Sign In to add comment