Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------------------------
- --the sun is a deadly laser--
- -----------------------------
- --By --
- --CKbackup-
- -----------
- player = game.Players.LocalPlayer
- chara = player.Character
- debby = game.Debris
- Mouse = player:GetMouse()
- attacking = false
- ArtificialHB = Instance.new("BindableEvent", script)
- ArtificialHB.Name = "Heartbeat"
- script:WaitForChild("Heartbeat")
- frame = 0.03333333333333
- tf = 0
- allowframeloss = false
- tossremainder = false
- lastframe = tick()
- script.Heartbeat:Fire()
- game:GetService("RunService").Heartbeat:connect(function(s, p)
- tf = tf + s
- if tf >= frame then
- if allowframeloss then
- script.Heartbeat:Fire()
- lastframe = tick()
- else
- for i = 1, math.floor(tf / frame) do
- script.Heartbeat:Fire()
- end
- lastframe = tick()
- end
- if tossremainder then
- tf = 0
- else
- tf = tf - frame * math.floor(tf / frame)
- end
- end
- end)
- function swait(num)
- if num == 0 or num == nil then
- ArtificialHB.Event:wait()
- else
- for i = 0, num*30 do
- ArtificialHB.Event:wait()
- end
- end
- end
- --Outfit--
- New = function(Object, Parent, Name, Data)
- local Object = Instance.new(Object)
- for Index, Value in pairs(Data or {}) do
- Object[Index] = Value
- end
- Object.Parent = Parent
- Object.Name = Name
- return Object
- end
- Sun = New("Part",chara,"SunPart",{BrickColor = BrickColor.new("Gold"),Material = Enum.Material.Neon,Size = Vector3.new(1, 1, 1),CFrame = CFrame.new(-4, 44.5, -7, 1, 0, 0, 0, 1, 0, 0, 0, 1),BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.937255, 0.721569, 0.219608),})
- Mesh = New("SpecialMesh",Sun,"Mesh",{Scale = Vector3.new(50, 50, 50),MeshType = Enum.MeshType.Sphere,})
- local bpos = Instance.new("BodyPosition",Sun)
- bpos.Position = chara.Head.Position + Vector3.new(0,50,0) + chara.Head.CFrame.lookVector*-50
- Sun.Position = chara.Head.Position + Vector3.new(0,50,0) + chara.Head.CFrame.lookVector*-50
- Sun.Transparency = 1
- swait(1)
- function CreateTrailObj(parent,color1,color2,ofsx,ofsz)
- local Att1 = New("Attachment",parent,"Att1",{Position = Vector3.new(ofsx,parent.Size.Y/2,ofsz)})
- local Att2 = New("Attachment",parent,"Att2",{Position = Vector3.new(ofsx,-(parent.Size.Y/2),ofsz)})
- local TEff = New("Trail",parent,"TrailEff",{Color = ColorSequence.new({ColorSequenceKeypoint.new(0,BrickColor.new(color1).Color),ColorSequenceKeypoint.new(1,BrickColor.new(color2).Color)}),Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,.5),NumberSequenceKeypoint.new(1,1)}),Attachment0 = Att1,Attachment1 = Att2,Enabled = false,Lifetime = .5,MinLength = .001})
- return TEff
- end
- --Sounds--
- function LoadSnd(id,loop,vol,pit)
- local snd = New("Sound",chara,"Sound",{SoundId = "rbxassetid://"..id,Looped = loop,Volume = vol,Pitch = pit})
- return snd
- end
- SwingSnd = LoadSnd(158037267,false,1,1)
- Swing2Snd = LoadSnd(12222208,false,1,1)
- HitSnd = LoadSnd(153092274,false,1,1)
- ExpSnd = LoadSnd(142070127,false,1,1)
- FlySnd = LoadSnd(169445602,false,1,1)
- BExpSnd = LoadSnd(168586621,false,1,.5)
- GunFlameSnd = LoadSnd(48618802,false,1,1.5)
- ChargeSnd = LoadSnd(136007472,false,1,1)
- Charge2Snd = LoadSnd(137463716,false,1,.7)
- BurnSnd = LoadSnd(32791565,false,3,1)
- BurningSnd = LoadSnd(31760113,true,5,1)
- LaserSnd = LoadSnd(178452221,false,1,.6)
- DeadlyLasSnd = LoadSnd(811841430,false,1,.8)
- --Play Sound in Part--
- function PlaySnd(snd,part)
- local sound = snd:Clone()
- sound.PlayOnRemove = true
- sound.Parent = part
- sound:Destroy()
- end
- --Damage Function--
- function dealdmg(dude,damage,env,toim,kby,kbx)
- hurt = coroutine.wrap(function()
- if dude ~= chara and dude:FindFirstChild("IsHit") == nil then
- finaldmg = damage + math.random(-env,env)
- dude.Humanoid.Health = dude.Humanoid.Health - finaldmg
- local vall = Instance.new("ObjectValue",dude)
- vall.Name = "IsHit"
- debby:AddItem(vall,toim)
- local bfos = Instance.new("BodyVelocity",dude.Head)
- bfos.P = 20000
- bfos.MaxForce = Vector3.new(bfos.P,bfos.P,bfos.P)
- bfos.Velocity = Vector3.new(0,kby,0) + chara.HumanoidRootPart.CFrame.lookVector * kbx
- debby:AddItem(bfos,.1)
- local naeeym2 = Instance.new("BillboardGui",dude)
- naeeym2.Size = UDim2.new(0,100,0,40)
- naeeym2.StudsOffset = Vector3.new(0,3,0)
- naeeym2.Adornee = dude.Head
- naeeym2.Name = "TalkingBillBoard"
- local tecks2 = Instance.new("TextLabel",naeeym2)
- tecks2.BackgroundTransparency = 1
- tecks2.BorderSizePixel = 0
- tecks2.Text = "-"..finaldmg
- tecks2.Font = "Fantasy"
- tecks2.FontSize = "Size24"
- tecks2.TextStrokeTransparency = 0
- tecks2.TextColor3 = Color3.new(1,0.6,0)
- tecks2.TextStrokeColor3 = Color3.new(0,0,0)
- tecks2.Size = UDim2.new(1,0,0.5,0)
- for i = 1, 5 do
- swait(.1)
- tecks2.Position = tecks2.Position - UDim2.new(0,0,.05,0)
- tecks2.TextStrokeTransparency = tecks2.TextStrokeTransparency +.2
- tecks2.TextTransparency = tecks2.TextTransparency + .2
- end
- naeeym2:Destroy()
- end
- end)
- hurt(dude,damage,env,toim)
- end
- --Burn Damage--
- function burndmg(dude)
- burndude = coroutine.wrap(function()
- if dude ~= chara then
- local dd = dude:GetChildren()
- for i = 1, #dd do
- if dd[i]:IsA("BasePart") then
- dd[i].BrickColor = BrickColor.new("Really black")
- FireEffect(dd[i])
- end
- end
- PlaySnd(BurnSnd,dude.Head)
- local snd2 = BurningSnd:clone()
- snd2.Parent = dude.Head
- snd2:Play()
- dude:BreakJoints()
- end
- end)
- burndude()
- end
- --Explode Hitbox--
- function ExHitbox(rad,pos)
- local E = Instance.new("Explosion")
- E.Position = pos
- E.Parent = game.Workspace
- E.BlastRadius = rad
- E.BlastPressure = 0
- E.Visible = false
- E.Hit:connect(function(hit)
- if hit.Parent:FindFirstChildOfClass("Humanoid")~=nil then
- burndmg(hit.Parent)
- end
- end)
- end
- --Material Return--
- gprop = {}
- function materialhit()
- local part = workspace:FindPartOnRay(Ray.new(chara.HumanoidRootPart.Position-Vector3.new(0,2.4,0),Vector3.new(0,-1000,0)))
- if part then
- gprop = {part.BrickColor,part.Material}
- end
- end
- --Clerp Animations--
- --TC = chara.HumanoidRootPart.RootJoint
- --HC = chara.Torso.Neck
- --RAC = chara.Torso["Right Shoulder"]
- --LAC = chara.Torso["Left Shoulder"]
- --RLC = chara.Torso["Right Hip"]
- --LLC = chara.Torso["Left Hip"]
- --TCF = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- --HCF = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- --RACF = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- --LACF = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- --RLCF = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- --LLCF = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- --RWF = CFrame.new(-1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- --LWF = CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- --RLWF = CFrame.new(-.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- --LLWF = CFrame.new(.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
- --RW = Instance.new("Weld",HC.Parent)
- --RW.Part1 = HC.Parent
- --RW.Part0 = chara["Right Arm"]
- --RW.C0 = RWF
- --LW = Instance.new("Weld",HC.Parent)
- --LW.Part1 = HC.Parent
- --LW.Part0 = chara["Left Arm"]
- --LW.C0 = LWF
- --RLW = nil
- --LLW = nil
- --
- --function AddLegWelds()
- --RLW = Instance.new("Weld",chara["Right Leg"])
- --RLW.Part1 = HC.Parent
- --RLW.Part0 = chara["Right Leg"]
- --RLW.C0 = RLWF
- --LLW = Instance.new("Weld",chara["Left Leg"])
- --LLW.Part1 = HC.Parent
- --LLW.Part0 = chara["Left Leg"]
- --LLW.C0 = LLWF
- --end
- --
- --function DestroyLegWelds()
- --RLC = New("Motor6D",chara.Torso,"Right Hip",{Part0 = chara.Torso,Part1 = chara["Right Leg"],C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),})
- --LLC = New("Motor6D",chara.Torso,"Left Hip",{Part0 = chara.Torso,Part1 = chara["Left Leg"],C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),})
- --RLW:Destroy()
- --LLW:Destroy()
- --end
- function clerp(a,b,c)
- return a:lerp(b,c)
- end
- --TC.C0 = TCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(90))
- --HC.C0 = HCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-50))
- --RW.C0 = (RWF + Vector3.new(1,2,0)) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-90))
- --LW.C0 = LWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(2))
- --TC.C0 = TCF
- --HC.C0 = HCF
- --RW.C0 = RWF
- --LW.C0 = LWF
- --
- ----Idle Clerp--
- --ITCF = TCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-50))
- --IHCF = HCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(50))
- --IRWF = RWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-5))
- --ILWF = LWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(5))
- --
- --function res()
- --TC.C0 = ITCF
- --HC.C0 = IHCF
- --RW.C0 = IRWF
- --LW.C0 = ILWF
- --end
- --res()
- ChargeSnd:Play()
- for i = 0, 2.5, .1 do
- swait(.1)
- bpos.Position = chara.Head.Position + Vector3.new(0,50,0) + chara.Head.CFrame.lookVector*-50
- Sun.Position = chara.Head.Position + Vector3.new(0,50,0) + chara.Head.CFrame.lookVector*-50
- Sun.Transparency = 1
- for i = 1, 3 do
- local tr = coroutine.resume(coroutine.create(function()
- local hitp = Instance.new("Part",game.Workspace)
- hitp.Size = Vector3.new(1,1,1)
- hitp.Anchored = true
- hitp.CanCollide = false
- hitp.BrickColor = BrickColor.new("Gold")
- hitp.Transparency = 1
- hitp.CFrame = Sun.CFrame * CFrame.fromEulerAnglesXYZ(math.random(0,math.rad(359)),math.random(0,math.rad(359)),math.random(0,math.rad(359)))
- local hitm = Instance.new("SpecialMesh",hitp)
- hitm.MeshId = "http://www.roblox.com/asset/?id=3270017"
- hitm.Scale = Vector3.new(4,4,1)
- for i = 0,1,.2 do
- swait()
- hitp.Transparency = i
- hitm.Scale = Vector3.new(100-i*50,100-i*50,1-i)
- end
- hitp:Destroy()
- end))
- end
- end
- swait(1.5)
- Sun.Transparency = 0
- bpos.Position = chara.Head.Position + Vector3.new(0,50,0) + chara.Head.CFrame.lookVector*-50
- Sun.Position = chara.Head.Position + Vector3.new(0,50,0) + chara.Head.CFrame.lookVector*-50
- BExpSnd:Play()
- local tr = coroutine.resume(coroutine.create(function()
- local hitp = Instance.new("Part",game.Workspace)
- hitp.Size = Vector3.new(1,1,1)
- hitp.Anchored = true
- hitp.CanCollide = false
- hitp.BrickColor = BrickColor.new("Gold")
- hitp.Material = "Neon"
- hitp.Transparency = 1
- hitp.CFrame = Sun.CFrame * CFrame.fromEulerAnglesXYZ(math.random(0,math.rad(359)),math.random(0,math.rad(359)),math.random(0,math.rad(359)))
- local hitm = Instance.new("SpecialMesh",hitp)
- hitm.MeshType = "Sphere"
- hitm.Scale = Vector3.new(1,1,1)
- for i = 0,1,.01 do
- swait()
- hitp.Transparency = i
- hitm.Scale = Vector3.new(50+i*45,50+i*45,50+i*45)
- end
- hitp:Destroy()
- end))
- for i = 0, 1, .1 do
- local tr = coroutine.resume(coroutine.create(function()
- local hitp = Instance.new("Part",game.Workspace)
- hitp.Size = Vector3.new(1,1,1)
- hitp.Anchored = true
- hitp.CanCollide = false
- hitp.BrickColor = BrickColor.new("Gold")
- hitp.Transparency = 1
- hitp.CFrame = Sun.CFrame * CFrame.fromEulerAnglesXYZ(math.random(0,math.rad(359)),math.random(0,math.rad(359)),math.random(0,math.rad(359)))
- local hitm = Instance.new("SpecialMesh",hitp)
- hitm.MeshId = "http://www.roblox.com/asset/?id=3270017"
- hitm.Scale = Vector3.new(4,4,1)
- for i = 0,1,.01 do
- swait()
- hitp.Transparency = i
- hitm.Scale = Vector3.new(50+i*50,50+i*50,i)
- end
- hitp:Destroy()
- end))
- end
- --Fire Effect-
- function FireEffect(part)
- if part:FindFirstChild("FireEffect")==nil then
- local fireeff = Instance.new("ParticleEmitter",part)
- fireeff.Name = "FireEffect"
- fireeff.Color = ColorSequence.new({ColorSequenceKeypoint.new(0,Color3.new(1,0,0)),ColorSequenceKeypoint.new(1,Color3.new(1,1,0))})
- fireeff.LightEmission = 1
- fireeff.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,1),NumberSequenceKeypoint.new(1,0)})
- fireeff.Texture = "rbxasset://textures/particles/smoke_main.dds"
- fireeff.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,0),NumberSequenceKeypoint.new(1,1)})
- fireeff.Acceleration = Vector3.new(0,30,0)
- fireeff.Lifetime = NumberRange.new(.5)
- fireeff.Rate = 1000
- fireeff.Rotation = NumberRange.new(0,359)
- fireeff.RotSpeed = NumberRange.new(100)
- fireeff.Speed = NumberRange.new(0)
- fireeff.VelocitySpread = 10
- return fireeff
- end
- end
- --lasser rasser--
- function Laser(Partt)
- local EffectPart = Instance.new("Part",game.Workspace)
- EffectPart.Size = Vector3.new(1,1,1)
- EffectPart.Anchored = true
- EffectPart.BrickColor = BrickColor.new("Gold")
- EffectPart.Material = "Neon"
- EffectPart.Position = Mouse.Hit.p
- EffectPart.CFrame = Mouse.Hit
- local mehs1 = Instance.new("SpecialMesh",EffectPart)
- mehs1.MeshType = "Sphere"
- mehs1.Scale = Vector3.new(2,2,2)
- local P = Instance.new("Part")
- local Place0 = Partt.CFrame
- local Place1 = EffectPart.CFrame
- local meshla = Instance.new("BlockMesh", P)
- meshla.Scale = Vector3.new(1,1,1)
- P.formFactor = 0
- P.Size = Vector3.new(1,1,(Place0.p - Place1.p).magnitude)
- P.Name = "Laser"
- P.CFrame = CFrame.new((Place0.p + Place1.p)/2,Place0.p)
- P.Parent = game.Workspace
- P.BrickColor = BrickColor.new("Gold")
- P.Material = "Neon"
- P.Anchored = true
- P.CanCollide = false
- P.Locked = true
- P.BottomSurface = "Smooth"
- P.TopSurface = "Smooth"
- DeadlyLasSnd:Play()
- PlaySnd(GunFlameSnd,chara)
- ExHitbox(5,Place1.p)
- for i = 0, 1, .1 do
- local tr = coroutine.resume(coroutine.create(function()
- local hitp = Instance.new("Part",game.Workspace)
- hitp.Size = Vector3.new(1,1,1)
- hitp.Anchored = true
- hitp.CanCollide = false
- hitp.BrickColor = BrickColor.new("Gold")
- hitp.Transparency = 1
- hitp.CFrame = EffectPart.CFrame * CFrame.fromEulerAnglesXYZ(math.random(0,math.rad(359)),math.random(0,math.rad(359)),math.random(0,math.rad(359)))
- local hitm = Instance.new("SpecialMesh",hitp)
- hitm.MeshId = "http://www.roblox.com/asset/?id=3270017"
- hitm.Scale = Vector3.new(4,4,1)
- for i = 0,1,.1 do
- swait()
- hitp.Transparency = i
- hitm.Scale = Vector3.new(i*20,i*20,i)
- end
- hitp:Destroy()
- end))
- end
- local fu = coroutine.wrap(function()
- for i = 1, 10 do
- swait(.01)
- mehs1.Scale = mehs1.Scale + Vector3.new(.5,.5,.5)
- meshla.Scale = meshla.Scale + Vector3.new(.25,.25,0)
- EffectPart.Transparency = EffectPart.Transparency + .1
- P.Transparency = P.Transparency + .1
- end
- ----
- P:Destroy()
- EffectPart:Destroy()
- end)
- fu()
- end
- --Cannon--
- function Cannon()
- del = true
- Charge2Snd:Play()
- for i = 0, 2.5, .1 do
- swait(.1)
- for i = 1, 3 do
- local tr = coroutine.resume(coroutine.create(function()
- local hitp = Instance.new("Part",chara)
- hitp.Size = Vector3.new(1,1,1)
- hitp.Anchored = true
- hitp.CanCollide = false
- hitp.BrickColor = BrickColor.new("Gold")
- hitp.Transparency = 1
- hitp.CFrame = Sun.CFrame * CFrame.fromEulerAnglesXYZ(math.random(0,math.rad(359)),math.random(0,math.rad(359)),math.random(0,math.rad(359)))
- local hitm = Instance.new("SpecialMesh",hitp)
- hitm.MeshId = "http://www.roblox.com/asset/?id=3270017"
- hitm.Scale = Vector3.new(4,4,1)
- for i = 0,1,.2 do
- swait()
- hitp.Transparency = i
- hitm.Scale = Vector3.new(100-i*50,100-i*50,1-i)
- end
- hitp:Destroy()
- end))
- end
- end
- swait(1.5)
- DeadlyLasSnd:Play()
- local EffectPart = Instance.new("Part",chara)
- EffectPart.Size = Vector3.new(1,1,1)
- EffectPart.Anchored = true
- EffectPart.BrickColor = BrickColor.new("Gold")
- EffectPart.Material = "Neon"
- local mehs1 = Instance.new("SpecialMesh",EffectPart)
- mehs1.MeshType = "Sphere"
- mehs1.Scale = Vector3.new(10,10,10)
- local P = Instance.new("Part")
- local meshla = Instance.new("BlockMesh", P)
- meshla.Scale = Vector3.new(5,5,1)
- for i = 1, 100 do
- swait()
- EffectPart.Position = Mouse.Hit.p
- EffectPart.CFrame = Mouse.Hit
- local Place0 = Sun.CFrame
- local Place1 = EffectPart.CFrame
- P.formFactor = 0
- P.Size = Vector3.new(1,1,(Place0.p - Place1.p).magnitude)
- P.Name = "Laser"
- P.CFrame = CFrame.new((Place0.p + Place1.p)/2,Place0.p)
- P.Parent = game.Workspace
- P.BrickColor = BrickColor.new("Gold")
- P.Material = "Neon"
- P.Anchored = true
- P.CanCollide = false
- P.Locked = true
- P.BottomSurface = "Smooth"
- P.TopSurface = "Smooth"
- PlaySnd(LaserSnd,chara)
- ExHitbox(15,Place1.p)
- for i = 1, 3 do
- local tr = coroutine.resume(coroutine.create(function()
- local hitp = Instance.new("Part",chara)
- hitp.Size = Vector3.new(1,1,1)
- hitp.Anchored = true
- hitp.CanCollide = false
- hitp.BrickColor = BrickColor.new("Gold")
- hitp.Transparency = 1
- hitp.CFrame = EffectPart.CFrame * CFrame.fromEulerAnglesXYZ(math.random(0,math.rad(359)),math.random(0,math.rad(359)),math.random(0,math.rad(359)))
- local hitm = Instance.new("SpecialMesh",hitp)
- hitm.MeshId = "http://www.roblox.com/asset/?id=3270017"
- hitm.Scale = Vector3.new(4,4,1)
- for i = 0,1,.1 do
- swait()
- hitp.Transparency = i
- hitm.Scale = Vector3.new(i*80,i*80,i)
- end
- hitp:Destroy()
- end))
- end
- end
- local fu = coroutine.wrap(function()
- for i = 1, 10 do
- swait(.01)
- mehs1.Scale = mehs1.Scale + Vector3.new(.5,.5,.5)
- meshla.Scale = meshla.Scale + Vector3.new(.25,.25,0)
- EffectPart.Transparency = EffectPart.Transparency + .1
- P.Transparency = P.Transparency + .1
- end
- ----
- P:Destroy()
- EffectPart:Destroy()
- end)
- fu()
- del = false
- end
- --Mouse Functions--
- del = false
- combo = 0
- function onKeyDown(key)
- if del == false then
- if key == "l" then
- Cannon()
- end
- end
- end
- function onButton1Down()
- if del == false then
- del = true
- Laser(Sun)
- swait(.5)
- del = false
- end
- end
- --Mouse Activation--
- if Mouse then
- Mouse.KeyDown:connect(onKeyDown)
- Mouse.Button1Down:connect(onButton1Down)
- end
- --Loop Function--
- walking = false
- while true do
- swait()
- bpos.Position = chara.Head.Position + Vector3.new(0,50,0) + chara.Head.CFrame.lookVector*-50
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement