Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted into script by Protofer_S, im bored
- wait()
- local player = owner
- local Tool = Instance.new("Tool") Tool.Name='RedHyperLaser' Tool.TextureId='rbxassetid://209727372' Tool.CanBeDropped=false
- local Handle = Instance.new("Part",Tool) Handle.Size=Vector3.new(0.58, 1.34, 2.48) Handle.Name='Handle'
- Tool.GripUp=Vector3.new(0,1,0) Tool.GripRight=Vector3.new(1,0,0) Tool.GripPos=Vector3.new(0, -0.1, 0.75) Tool.GripForward=Vector3.new(0,0,-1)
- local mesh = Instance.new("SpecialMesh",Handle) mesh.MeshId='http://www.roblox.com/asset/?id=130099641' mesh.TextureId='rbxassetid://209727730'
- local light = Instance.new("PointLight",Handle) light.Color=Color3.new(1, 0, 0) light.Brightness=1 light.Range=6
- mesh.Scale=Vector3.new(0.65, 0.65, 0.65)
- Tool.Parent=player.Backpack
- local firesound = Instance.new("Sound",Handle) firesound.SoundId='http://www.roblox.com/asset?id=130113322' firesound.PlaybackSpeed=0.85 firesound.Name='Fire'
- local reloadsound = Instance.new("Sound",Handle) reloadsound.SoundId='http://www.roblox.com/asset?id=130113370' reloadsound.PlaybackSpeed=0.85 reloadsound.Name='Reload'
- local fade = Instance.new("Sound",Handle) fade.SoundId='http://www.roblox.com/asset?id=130113415' fade.PlaybackSpeed=0.85 fade.Name='HitFade'
- --Rescripted by Luckymaxer
- function icon()
- NLS([[
- local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
- local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
- local Tool = script.Parent
- local Mouse = nil
- local function UpdateIcon()
- if Mouse then
- Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
- end
- end
- local function OnEquipped(mouse)
- Mouse = mouse
- UpdateIcon()
- end
- local function OnChanged(property)
- if property == 'Enabled' then
- UpdateIcon()
- end
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Changed:connect(OnChanged)
- ]],Tool)
- end
- function scrip()
- icon()
- NLS([[
- --Rescripted by Luckymaxer
- Tool = script.Parent
- Handle = Tool:WaitForChild("Handle")
- Players = game:GetService("Players")
- ServerControl = Tool:WaitForChild("ServerControl")
- ClientControl = Tool:WaitForChild("ClientControl")
- ClientControl.OnClientInvoke = (function(Mode, Value)
- if Mode == "PlaySound" and Value then
- Value:Play()
- end
- end)
- function InvokeServer(Mode, Value, arg)
- pcall(function()
- ServerControl:InvokeServer(Mode, Value, arg)
- end)
- end
- function Equipped(Mouse)
- Character = Tool.Parent
- Player = Players:GetPlayerFromCharacter(Character)
- Humanoid = Character:FindFirstChild("Humanoid")
- if not Player or not Humanoid or Humanoid.Health == 0 then
- return
- end
- Mouse.Button1Down:connect(function()
- InvokeServer("Click", true, Mouse.Hit.p)
- end)
- end
- local function Unequipped()
- end
- Tool.Equipped:connect(Equipped)
- Tool.Unequipped:connect(Unequipped)
- ]],Tool)
- end
- scrip()
- Tool.Activated:Connect(function()
- local test1 = Handle:FindFirstChild('Fire')
- if test1 then
- else
- firesound = Instance.new("Sound",Handle) firesound.SoundId='http://www.roblox.com/asset?id=130113322' firesound.PlaybackSpeed=0.85 firesound.Name='Fire'
- end
- local test2 = Handle:FindFirstChild('Reload')
- if test2 then
- else
- reloadsound = Instance.new("Sound",Handle) reloadsound.SoundId='http://www.roblox.com/asset?id=130113370' reloadsound.PlaybackSpeed=0.85 reloadsound.Name='Reload'
- end
- local test3 = Handle:FindFirstChild('HitFade')
- if test3 then
- else
- fade = Instance.new("Sound",Handle) fade.SoundId='http://www.roblox.com/asset?id=130113415' fade.PlaybackSpeed=0.85 fade.Name='HitFade'
- end
- local test4 = Handle:FindFirstChild('PointLight')
- if not test4 then
- light = Instance.new("PointLight",Handle) light.Color=Color3.new(1, 0, 0) light.Brightness=1 light.Range=6
- end
- end)
- Players = game:GetService("Players")
- Debris = game:GetService("Debris")
- Speed = 100
- Duration = 2
- NozzleOffset = Vector3.new(0, 0.4, -1.1)
- Sounds = {
- Fire = firesound,
- Reload = reloadsound,
- HitFade = fade
- }
- PointLight = light
- ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
- ServerControl.Name = "ServerControl"
- ServerControl.Parent = Tool
- ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
- ClientControl.Name = "ClientControl"
- ClientControl.Parent = Tool
- ServerControl.OnServerInvoke = (function(player, Mode, Value, arg)
- if player ~= Player or Humanoid.Health == 0 or not Tool.Enabled then
- return
- end
- if Mode == "Click" and Value then
- Activated(arg)
- end
- end)
- function InvokeClient(Mode, Value)
- pcall(function()
- ClientControl:InvokeClient(Player, Mode, Value)
- end)
- end
- function TagHumanoid(humanoid, player)
- local Creator_Tag = Instance.new("ObjectValue")
- Creator_Tag.Name = "creator"
- Creator_Tag.Value = player
- Debris:AddItem(Creator_Tag, 2)
- Creator_Tag.Parent = humanoid
- end
- function UntagHumanoid(humanoid)
- for i, v in pairs(humanoid:GetChildren()) do
- if v:IsA("ObjectValue") and v.Name == "creator" then
- v:Destroy()
- end
- end
- end
- function FindCharacterAncestor(Parent)
- if Parent and Parent ~= game:GetService("Workspace") then
- local humanoid = Parent:FindFirstChildOfClass("Humanoid")
- if humanoid then
- return Parent, humanoid
- else
- return FindCharacterAncestor(Parent.Parent)
- end
- end
- return nil
- end
- function GetTransparentsRecursive(Parent, PartsTable)
- local PartsTable = (PartsTable or {})
- for i, v in pairs(Parent:GetChildren()) do
- local TransparencyExists = false
- pcall(function()
- local Transparency = v["Transparency"]
- if Transparency then
- TransparencyExists = true
- end
- end)
- if TransparencyExists then
- table.insert(PartsTable, v)
- end
- GetTransparentsRecursive(v, PartsTable)
- end
- return PartsTable
- end
- function SelectionBoxify(Object)
- local SelectionBox = Instance.new("SelectionBox")
- SelectionBox.Adornee = Object
- SelectionBox.Color = BrickColor.new("Really red")
- SelectionBox.Parent = Object
- return SelectionBox
- end
- local function Light(Object)
- local Light = PointLight:Clone()
- Light.Range = (Light.Range + 2)
- Light.Parent = Object
- end
- function FadeOutObjects(Objects, FadeIncrement)
- repeat
- local LastObject = nil
- for i, v in pairs(Objects) do
- v.Transparency = (v.Transparency + FadeIncrement)
- LastObject = v
- end
- wait()
- until LastObject.Transparency >= 1 or not LastObject
- end
- function Dematerialize(character, humanoid, FirstPart)
- if not character or not humanoid then
- return
- end
- humanoid.WalkSpeed = 0
- local Parts = {}
- for i, v in pairs(character:GetChildren()) do
- if v:IsA("BasePart") then
- v.Anchored = true
- table.insert(Parts, v)
- elseif v:IsA("LocalScript") or v:IsA("Script") then
- v:Destroy()
- end
- end
- local SelectionBoxes = {}
- local FirstSelectionBox = SelectionBoxify(FirstPart)
- Light(FirstPart)
- wait(0.05)
- for i, v in pairs(Parts) do
- if v ~= FirstPart then
- table.insert(SelectionBoxes, SelectionBoxify(v))
- Light(v)
- end
- end
- local ObjectsWithTransparency = GetTransparentsRecursive(character)
- FadeOutObjects(ObjectsWithTransparency, 0.1)
- wait(0.5)
- character:BreakJoints()
- humanoid.Health = 0
- Debris:AddItem(character, 2)
- local FadeIncrement = 0.05
- Delay(0.2, function()
- FadeOutObjects({FirstSelectionBox}, FadeIncrement)
- if character and character.Parent then
- character:Destroy()
- end
- end)
- FadeOutObjects(SelectionBoxes, FadeIncrement)
- end
- function Touched(Projectile, Hit)
- if not Hit or not Hit.Parent then
- return
- end
- local character, humanoid = FindCharacterAncestor(Hit)
- if character and humanoid and character ~= Character then
- local ForceFieldExists = false
- for i, v in pairs(character:GetChildren()) do
- if v:IsA("ForceField") then
- print('Ew a forcefield, lets kill it :)')
- --ForceFieldExists = true
- end
- end
- if not ForceFieldExists then
- if Projectile then
- local HitFadeSound = Projectile:FindFirstChild(Sounds.HitFade.Name)
- local torso = humanoid.Torso
- if HitFadeSound and torso then
- HitFadeSound.Parent = torso
- HitFadeSound:Play()
- end
- end
- Dematerialize(character, humanoid, Hit)
- end
- if Projectile and Projectile.Parent then
- Projectile:Destroy()
- end
- end
- end
- function Equipped()
- Character = Tool.Parent
- Player = Players:GetPlayerFromCharacter(Character)
- Humanoid = Character:FindFirstChild("Humanoid")
- if not Player or not Humanoid or Humanoid.Health == 0 then
- return
- end
- end
- function Activated(target)
- if Tool.Enabled and Humanoid.Health > 0 then
- Tool.Enabled = false
- InvokeClient("PlaySound", Sounds.Fire)
- local HandleCFrame = Handle.CFrame
- local FiringPoint = HandleCFrame.p + HandleCFrame:vectorToWorldSpace(NozzleOffset)
- local ShotCFrame = CFrame.new(FiringPoint, target)
- local LaserShotClone = BaseShot:Clone()
- LaserShotClone.CFrame = ShotCFrame + (ShotCFrame.lookVector * (BaseShot.Size.Z / 2))
- local BodyVelocity = Instance.new("BodyVelocity")
- BodyVelocity.velocity = ShotCFrame.lookVector * Speed
- BodyVelocity.Parent = LaserShotClone
- LaserShotClone.Touched:connect(function(Hit)
- if not Hit or not Hit.Parent then
- return
- end
- Touched(LaserShotClone, Hit)
- end)
- Debris:AddItem(LaserShotClone, Duration)
- LaserShotClone.Parent = game:GetService("Workspace")
- wait(0.6) -- FireSound length
- InvokeClient("PlaySound", Sounds.Reload)
- wait(0.75) -- ReloadSound length
- Tool.Enabled = true
- end
- end
- function Unequipped()
- end
- BaseShot = Instance.new("Part")
- BaseShot.Name = "Effect"
- BaseShot.BrickColor = BrickColor.new("Really red")
- BaseShot.Material = Enum.Material.Plastic
- BaseShot.Shape = Enum.PartType.Block
- BaseShot.TopSurface = Enum.SurfaceType.Smooth
- BaseShot.BottomSurface = Enum.SurfaceType.Smooth
- BaseShot.FormFactor = Enum.FormFactor.Custom
- BaseShot.Size = Vector3.new(0.2, 0.2, 3)
- BaseShot.CanCollide = false
- BaseShot.Locked = true
- SelectionBoxify(BaseShot)
- Light(BaseShot)
- BaseShotSound = Sounds.HitFade:Clone()
- BaseShotSound.Parent = BaseShot
- Tool.Equipped:connect(Equipped)
- Tool.Unequipped:connect(Unequipped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement