Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = owner
- local ch = owner.Character
- local hum = ch.Humanoid
- local root = ch.HumanoidRootPart
- local mode = "Blessing"
- local bullets = {}
- local mPos = nil
- local tracking = false
- local CF = CFrame.new
- local ANG = CFrame.Angles
- local RAN = math.random
- local C3 = Color3.new
- local RGB = Color3.fromRGB
- local VT = Vector3.new
- local UD = UDim2.new
- local SEQ = NumberSequence.new
- local CSEQ = ColorSequence.new
- local NKEY = NumberSequenceKeypoint.new
- local RANGE = NumberRange.new
- --_________________MISC (FOLDERS)___________________________
- local attackFolder = Instance.new("Folder")
- attackFolder.Parent = ch
- --__________________CORE FUNCTIONS___________________________
- local function hwait(t)
- if t then
- for i = 1,t do
- game:GetService("RunService").Stepped:Wait()
- end
- else
- return game:GetService("RunService").Stepped:Wait()
- end
- end
- local createSeq = function(stuffs)
- a = {}
- for i,v in pairs(stuffs) do
- table.insert(a, NumberSequenceKeypoint.new(v.Time, v.Val))
- end
- return NumberSequence.new(a)
- end
- local function randneg(num1, num2)
- times = 1
- if math.random(1,2) == 1 then
- times = 1
- else
- times = -1
- end
- return math.random(num1, num2)*times
- end
- local function castRay(startPos, endPos)
- local results = workspace:Raycast(startPos, endPos)
- if results then
- return results
- else return nil
- end
- end
- local curl = function(part, angle, duration)
- local push = 5
- for i = 1,duration*50 do
- push = push - 0.1
- part.CFrame = part.CFrame:Lerp(part.CFrame * angle, 0.1)
- part.CFrame = part.CFrame:Lerp(part.CFrame * CFrame.new(math.random(5, 20)/2, math.random(15, 30)/2 + push, math.random(5, 20)/2), 0.2)
- hwait()
- end
- end
- function make(inst, parent, details)
- local Item = Instance.new(inst)
- if details then
- for i,v in pairs(details) do
- Item[i] = v
- end
- end
- Item.Parent = parent or nil
- return Item
- end
- function clone(part, col, aftersize, aftercol)
- if not part:IsA("SpecialMesh") then
- local p = make("Part", workspace, {Anchored = true, CanCollide = false, Shape = part.Shape, CFrame = part.CFrame, Material = "Neon", Name = "Clone piece", Color = col})
- if part.Name ~= "Head" then
- p.Size = part.Size + Vector3.new(.02,.02,.02)
- else
- p.Size = Vector3.new(1,1,1) + Vector3.new(.02,.02,.02)
- end
- spawn(function()
- for i = 1,15 do
- p.Transparency = i/15
- if aftersize then
- p.Size = p.Size:Lerp(aftersize, 0.1)
- end
- if aftercol then
- p.Color = p.Color:Lerp(aftercol, 0.1)
- end
- task.wait()
- end
- p:Remove()
- end)
- else
- local p = make("Part", workspace, {Anchored = true, CanCollide = false, CFrame = part.Parent.CFrame, Material = "Neon", Name = "Clone piece", Color = col})
- if part.Parent.Name ~= "Head" then
- p.Size = part.Parent.Size + Vector3.new(.02,.02,.02)
- else
- p.Size = Vector3.new(1,1,1) + Vector3.new(.02,.02,.02)
- end
- pm = make("SpecialMesh", p, {MeshType = "Sphere"})
- spawn(function()
- for i = 1,15 do
- p.Transparency = i/15
- if aftersize then
- p.Size = p.Size:Lerp(aftersize, 0.1)
- end
- if aftercol then
- p.Color = p.Color:Lerp(aftercol, 0.1)
- end
- task.wait()
- end
- p:Remove()
- end)
- end
- end
- --_______________TOOL FUNCTIONALITY PT1.______________________
- local tool = Instance.new("Tool")
- local handle = Instance.new("Part")
- handle.Transparency = 1
- handle.CanCollide = false
- handle.Name = "Handle"
- handle.Parent = tool
- tool.Name = "Blight v Blessing"
- local ev = Instance.new("RemoteEvent")
- ev.Name = "KeyDownEv"
- ev.Parent = tool --just to make sure its removed by g/no.sr
- LOCAL = [[
- local plr = owner
- local ev = (function() if plr.Backpack:FindFirstChild("Blight v Blessing") then return plr.Backpack["Blight v Blessing"]:WaitForChild("KeyDownEv") elseif plr.Character:FindFirstChild("Blight v Blessing") then return plr.Character["Blight v Blessing"]:WaitForChild("KeyDownEv") end end)()
- local mouse = plr:GetMouse()
- local hold = false
- local mode = "Blessing"
- local modes = {
- {mode = "Blessing", msg = "+ Blessing mode initiated. +", dedikey = "z", desc = "Second most fling force. Heals 10-20 HP."},
- {mode = "Blight", msg = "x Blight mode engaged. x", dedikey = "x", desc = "Does less fling force than Blessing and does 10-20 HP worth of damage."},
- {mode = "Death", msg = "! Insta-death mode activated. !", dedikey = "c", desc = "Does the most fling force - sending most to the deadzone (floating point limit). Does no damage."},
- {mode = "Combustion", msg = "* Combustion mode loaded. *", dedikey = "v", desc = "Causes the head of anyone hit to explode. Usually not survivable..."},
- {mode = "Clean", msg = "$ Cleaner mode hired. $", dedikey = "b", desc = "Cleans up/removes unanchored parts. Mostly for when Val (mald) joins and summons his endless list of friends."}
- }
- local keys = {"z", "x", "c", "v", "b"}
- function newOwner()
- print("Hello "..(plr.DisplayName or plr.Name).."!")
- print("Click to attack, and hold Q to aim!")
- print("Modes: ")
- for i,v in pairs(modes) do
- print(v["mode"].." ("..v["dedikey"].."): "..v["desc"])
- end
- end
- mouse.KeyDown:Connect(function(key)
- if key == "z" then
- mode = "Blessing"
- elseif key == "x" then
- mode = "Blight"
- elseif key == "c" then
- mode = "Death"
- elseif key == "v" then
- mode = "Combustion"
- elseif key == "b" then
- mode = "Clean"
- elseif key == "q" then
- hold = true
- print("= Tracking mouse! =")
- spawn(function()
- repeat
- task.wait()
- ev:FireServer("Tracking", mouse.hit)
- until hold == false
- ev:FireServer("NotTracking")
- print("- Tracking complete! -")
- end)
- end
- if k ~= "q" and table.find(keys, key) then
- ev:FireServer("Switch", mode)
- for i,v in pairs(modes) do
- if v["mode"] == mode then
- print(v["msg"])
- end
- end
- end
- end)
- mouse.KeyUp:Connect(function()
- hold = false
- end)
- newOwner()
- ]]
- tool.Parent = plr.Backpack
- --_______________________ATTACKS.________________________
- local pte = function(parent, lightemission, lightinfluence, color, transparency, drag, locked, accel, rate, lifetime, rotspeed, rotation, spread, speed, size, texture, z, direction, enabled)
- local pe = Instance.new("ParticleEmitter")
- pe.LightEmission = lightemission
- pe.LightInfluence = lightinfluence
- pe.Color = color
- pe.Size = size
- pe.Transparency = transparency
- pe.ZOffset = z
- pe.EmissionDirection = direction
- pe.Rate = rate
- pe.LockedToPart = locked
- pe.Acceleration = accel or Vector3.new(0,0,0)
- pe.Lifetime = lifetime
- pe.RotSpeed = rotspeed
- pe.Rotation = rotation
- pe.SpreadAngle = spread
- pe.Speed = speed
- pe.Texture = texture
- pe.Enabled = enabled
- pe.Drag = drag
- pe.Parent = parent
- return pe
- end
- function trailburst(place, color1, color2)
- local orr = place
- for i = 1,50 do
- local trail = Instance.new("Trail")
- trail.FaceCamera = true
- trail.LightEmission = (function()
- _,_,v = color1:ToHSV()
- return v
- end)()
- trail.WidthScale = createSeq({{Time = 0, Val = 0}, {Time = 0.35, Val = 1}, {Time = 1, Val = 2}})
- trail.Color = ColorSequence.new(color1)
- trail.Transparency = createSeq({{Time = 0, Val = 1}, {Time = 0.2, Val = 0}, {Time = 1, Val = 1}})
- trail.Lifetime = .25
- local p = Instance.new("Part")
- local li = Instance.new("PointLight")
- li.Color = color1
- li.Parent = p
- p.Transparency = 1
- p.CanCollide = false
- p.Anchored = true
- p.CFrame = orr * CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360)))
- trail.Parent = p
- att = Instance.new("Attachment", p)
- att.Position = Vector3.new(0,1,0)
- att2 = Instance.new("Attachment", p)
- att2.Position = Vector3.new(0,-1,0)
- trail.Attachment0 = att
- trail.Attachment1 = att2
- p.Parent = script
- spawn(function()
- for i = 1,3 do
- curl(p, CFrame.Angles(math.rad(randneg(40, 50)),math.rad(randneg(40, 50)),math.rad(randneg(40, 50))), 1)
- hwait()
- end
- trail.Enabled = false
- game.Debris:AddItem(p, 1)
- end)
- end
- end
- function contact_explosion(size, origin, place, effect)
- local blast = Instance.new("Part")
- local spM = Instance.new("SpecialMesh", blast)
- spM.MeshType = "Sphere"
- blast.Material = "Neon"
- blast.Color = origin.Color
- blast.Anchored = true
- blast.CanCollide = false
- blast.Size = Vector3.new(10, 10, 10)
- blast.Position = place
- blast.Parent = attackFolder
- spawn(function()
- trailburst(origin.CFrame, origin.Color)
- end)
- blast.Touched:Connect(function(h)
- if h.Anchored == false and not h.Parent:FindFirstChild("Humanoid") and not h.Parent.Parent:FindFirstChild("Humanoid") and effect and effect == "Remove" then
- clone(h, Color3.new(1, 0.6, 1), Vector3.new(0,0,0))
- h:Remove()
- end
- end)
- spawn(function()
- for _, player in pairs(game.Players:GetChildren()) do
- dist = player:DistanceFromCharacter(blast.Position)
- if dist <= (100 + size + math.random(3,30 + (size/10)*3))/2 then --and not effected[player.Name]
- --effected[player.Name] = true
- if effect and effect == "Damage" then
- local bv = Instance.new("BodyVelocity")
- bv.Velocity = Vector3.new(math.random(-500, 500), math.random(0, 200), math.random(-500, 500))/2
- bv.MaxForce = Vector3.new(1e9, 1e9, 1e9)
- pcall(function()
- bv.Parent = player.Character.Head
- if player.Character:FindFirstChildOfClass("ForceField") then player.Character:FindFirstChildOfClass("ForceField"):Remove() end
- if player.Character.Humanoid:FindFirstChildOfClass("ForceField") then player.Character.Humanoid:FindFirstChildOfClass("ForceField"):Remove() end
- player.Character.Humanoid:TakeDamage(math.random(30, 50))
- end)
- game.Debris:AddItem(bv, 0.2)
- elseif effect and effect == "Evicerate" then
- local bv = Instance.new("BodyVelocity")
- bv.Velocity = Vector3.new(math.random(-50000000, 50000000), math.random(0, 20000000), math.random(-50000000, 50000000))
- bv.MaxForce = Vector3.new(1e9, 1e9, 1e9)
- pcall(function()
- bv.Parent = player.Character.Head
- end)
- game.Debris:AddItem(bv, 0.2)
- elseif effect and effect == "Explode" then
- local bv = Instance.new("BodyVelocity")
- bv.Velocity = Vector3.new(math.random(-500, 500), math.random(0, 200), math.random(-500, 500))
- bv.MaxForce = Vector3.new(1e9, 1e9, 1e9)
- pcall(function()
- if player.Character:FindFirstChildOfClass("ForceField") then player.Character:FindFirstChildOfClass("ForceField"):Remove() end
- if player.Character.Humanoid:FindFirstChildOfClass("ForceField") then player.Character.Humanoid:FindFirstChildOfClass("ForceField"):Remove() end
- bv.Parent = player.Character.Head
- local ex = Instance.new("Explosion")
- ex.Visible = false
- ex.Position = player.Character.Head.Position
- ex.Parent = workspace
- end)
- game.Debris:AddItem(bv, 0.2)
- elseif effect and effect == "Remove" then
- local bv = Instance.new("BodyVelocity")
- bv.Velocity = Vector3.new(math.random(-250, 250), math.random(0, 100), math.random(-250, 250))
- bv.MaxForce = Vector3.new(1e9, 1e9, 1e9)
- pcall(function()
- bv.Parent = player.Character.Head
- end)
- game.Debris:AddItem(bv, 0.2)
- else
- local bv = Instance.new("BodyVelocity")
- bv.Velocity = Vector3.new(math.random(-500, 500), math.random(0, 200), math.random(-500, 500))
- bv.MaxForce = Vector3.new(1e9, 1e9, 1e9)
- pcall(function()
- bv.Parent = player.Character.Head
- player.Character.Humanoid:TakeDamage(-math.random(10, 20))
- end)
- game.Debris:AddItem(bv, 0.2)
- end
- end
- end
- for new_i = 1, 20 do
- blast.Size = blast.Size:Lerp(Vector3.new(100 + size + math.random(3,30 + (size/10)*3), 100 + size + math.random(3,30 + (size/10)*3), 100 + size + math.random(3,30 + (size/10)*3)), 0.2)
- hwait()
- blast.Transparency = new_i/20
- end
- blast:Remove()
- end)
- end
- local function fly(item, position)
- if tracking then
- local bg = item.BodyGyro
- item.Anchored = false
- bg.MaxTorque = Vector3.new(9000,9000,9000)
- bg.D = math.clamp(bg.D - 1, 50, math.huge)
- bg.P = math.clamp(bg.P + 2, 100, 5000)
- bg.CFrame = CFrame.new(item.Position, mPos.p)
- local direction = item.CFrame.lookVector * 100
- local position = position + direction
- local err = position - item.Position
- item.Velocity = 5*err
- else
- item.Anchored = true
- item.BodyGyro.MaxTorque = Vector3.new(0,0,0)
- item.BodyGyro.D = 200
- item.BodyGyro.P = 1500
- item.CFrame = item.CFrame * CFrame.new(0, 0, -10)
- end
- end
- function blast()
- local bullet = Instance.new("Part")
- local spM = Instance.new("SpecialMesh", bullet)
- spM.MeshType = "Sphere"
- local ty = Instance.new("StringValue")
- ty.Name = "Type"
- ty.Parent = bullet
- bullet.Name = "Active"
- bullet.Anchored = true
- bullet.CanCollide = false
- bullet.Material = "Neon"
- bullet.Size = Vector3.new(2,2,2)
- bullet.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -5) --the root is always backward for some reason.
- bullet.Color = (function()
- if mode == "Blessing" then
- ty.Value = "Heal"
- return Color3.new(.5, 1, .5)
- elseif mode == "Death" then
- ty.Value = "Evicerate"
- return Color3.new(.4, .4, .4)
- elseif mode == "Combustion" then
- ty.Value = "Explode"
- return Color3.new(1, .5, 0)
- elseif mode == "Clean" then
- ty.Value = "Remove"
- return Color3.new(1, .5, 1)
- else
- ty.Value = "Damage"
- return Color3.new(.2, 0, 0)
- end
- end)()
- local bg = Instance.new("BodyGyro")
- bg.D = 200
- bg.P = 1500
- bg.Name = "BodyGyro"
- bg.MaxTorque = Vector3.new(0,0,0)
- bg.Parent = bullet
- attach = make("Attachment", bullet, {Position = Vector3.new(0,bullet.Size.Y/2,0)})
- attach2 = make("Attachment", bullet, {Position = Vector3.new(0,-bullet.Size.Y/2,0)})
- trail = Instance.new("Trail")
- trail.FaceCamera = true
- trail.LightEmission = (function()
- _,_,v = bullet.Color:ToHSV()
- return v
- end)()
- trail.Color = ColorSequence.new(bullet.Color)
- trail.Transparency = NumberSequence.new({
- NumberSequenceKeypoint.new(0,0),
- NumberSequenceKeypoint.new(0.5,0),
- NumberSequenceKeypoint.new(1,1)
- })
- trail.WidthScale = NumberSequence.new({
- NumberSequenceKeypoint.new(0,1),
- NumberSequenceKeypoint.new(1,0)})
- trail.Lifetime = 1
- trail.Parent = bullet
- trail.Attachment0 = attach
- trail.Attachment1 = attach2
- bullet.Parent = attackFolder
- spawn(function()
- --charge
- for i = 1, 20 do
- bullet.Size = bullet.Size:Lerp(Vector3.new(math.random(3,5), math.random(3,5), math.random(3,5)), 0.2)
- hwait()
- end
- bullet.Size = Vector3.new(0,0,0)
- bullet.Transparency = 1
- local pt = pte(bullet, trail.LightEmission, 0, CSEQ(bullet.Color), SEQ({NKEY(0,0), NKEY(1,0)}), 0, true, nil, 100, NumberRange.new(.1), NumberRange.new(100), NumberRange.new(0), Vector2.new(0), NumberRange.new(0), SEQ({NKEY(0,0),NKEY(0.2,10),NKEY(0.8,10),NKEY(1,0)}), "rbxassetid://2273224484", 3, "Top", true)
- table.insert(bullets, bullet)
- game.Debris:AddItem(bullet, 5)
- end)
- end
- game:GetService("RunService").Stepped:Connect(function()
- for i,item in pairs(bullets) do
- if item and item:IsDescendantOf(workspace) and item.Name == "Active" then
- local res = castRay(item.CFrame.p, (item.CFrame * CFrame.new(0, 0, -10)).p)
- if (res and res.Position) and (res.Instance and not res.Instance:IsDescendantOf(plr.Character) and not res.Instance:IsDescendantOf(script)) then
- contact_explosion(0, item, res.Position, item.Type.Value)
- end
- fly(item, item.Position)
- elseif not item:IsDescendantOf(workspace) then
- bullets[i] = nil
- end
- end
- end)
- --_____________________EVENT BINDING STUFF.____________________
- ev.OnServerEvent:Connect(function(pl, cmd, newMode)
- if cmd == "Switch" then
- mode = newMode
- --will set mode to whatever was fired to the server in that local script.
- elseif cmd == "Tracking" then
- tracking = true
- mPos = newMode
- elseif cmd == "NotTracking" then
- tracking = false
- mPos = CFrame.new(0, 10000, 0)
- end
- end)
- tool.Activated:Connect(function()
- blast()
- end)
- tool.AncestryChanged:Connect(function()
- if tool.Parent:IsA("Model") and game.Players:GetPlayerFromCharacter(tool.Parent) and game.Players:GetPlayerFromCharacter(tool.Parent) ~= plr then
- plr = game.Players:GetPlayerFromCharacter(tool.Parent)
- attackFolder.Parent = plr.Character
- NLS(LOCAL, plr.Character)
- end
- end)
- script.Parent = tool
- NLS(LOCAL, plr.Character)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement