Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer
- local tool = Instance.new("Tool",plr.Backpack)
- tool.Name = "Laser sword"
- tool.GripPos = Vector3.new(0,-0.2,0)
- handle = Instance.new("Part",tool)
- handle.Name = "Handle"
- handle.Size = Vector3.new(0.55,1,0.55)
- handle.Color = Color3.fromRGB(0,0,0)
- handle.CanCollide = false
- handle.Material = Enum.Material.Metal
- handle.CFrame = plr.Character:FindFirstChild("Right Arm").CFrame
- lazer = Instance.new("Part",handle)
- lazer.Name = "Handle"
- lazer.CanCollide = false
- lazer.Size = Vector3.new(0.55,2.5,0.55)
- lazer.Color = Color3.fromRGB(255,255,255)
- lazer.Material = Enum.Material.Neon
- lazer.Touched:Connect(function(hit)
- humanoid = hit.Parent:FindFirstChildOfClass("Humanoid")
- if humanoid and hit.Parent ~= plr.Character and humanoid.Health ~= 0 then
- humanoid:TakeDamage(5)
- if humanoid.Health <= 0 then
- humanoid.RootPart.Velocity = humanoid.RootPart.CFrame.LookVector * -50
- for _, part in pairs(humanoid.Parent:GetChildren()) do
- if part:IsA("BasePart") then
- part.Color = Color3.fromRGB(255, 255, 255)
- part.Material = Enum.Material.Neon
- fire = Instance.new("Fire", part)
- fire.Color = Color3.fromRGB(255, 255, 255)
- fire.SecondaryColor = fire.Color
- fire.Heat = 0
- fire.Size = 6
- end
- end
- end
- end
- end)
- slash = Instance.new("Sound", handle)
- slash.Name = "Saber Slash"
- slash.Volume = 1
- slash.PlaybackSpeed = 1
- slash.Looped = false
- local lastPressTime = 0
- tool.Activated:Connect(function()
- local currentTime = tick()
- if currentTime - lastPressTime >= 1 then
- lastPressTime = currentTime
- ran = math.random(1, 2)
- if ran == 1 then
- local Anim = Instance.new("Animation")
- Anim.AnimationId = "rbxassetid://203875401"
- local k = game:GetService("Players").LocalPlayer.Character.Humanoid:LoadAnimation(Anim)
- k.Looped = false
- k:AdjustSpeed(1)
- k:Play()
- slash.SoundId = "rbxassetid://89357738"
- slash:Play()
- else
- local Anim = Instance.new("Animation")
- Anim.AnimationId = "rbxassetid://203876950"
- local k = game:GetService("Players").LocalPlayer.Character.Humanoid:LoadAnimation(Anim)
- k.Looped = false
- k:AdjustSpeed(1)
- k:Play()
- slash.SoundId = "rbxassetid://89357340"
- slash:Play()
- end
- end
- end)
- tool.Equipped:Connect(function()
- local Anim = Instance.new("Animation")
- Anim.AnimationId = "rbxassetid://94160581"
- local k = game:GetService("Players").LocalPlayer.Character.Humanoid:LoadAnimation(Anim)
- k:Play()
- k:AdjustSpeed(1)
- S1 = Instance.new("Sound", lazer)
- S1.Name = "Equip Sound"
- S1.SoundId = "rbxassetid://1194454803"
- S1.Volume = 1
- S1.PlaybackSpeed = 1
- S1.Looped = false
- S1:Play()
- S2 = Instance.new("Sound", lazer)
- S2.Name = "Loop Lazer"
- S2.SoundId = "rbxassetid://89357191"
- S2.Volume = 1
- S2.PlaybackSpeed = 1
- S2.Looped = true
- S2:Play()
- end)
- tool.Unequipped:Connect(function()
- S2:Stop()
- S3 = Instance.new("Sound", plr.Character.HumanoidRootPart)
- S3.Name = "Unequip"
- S3.SoundId = "rbxassetid://1194453600"
- S3.Volume = 1
- S3.PlaybackSpeed = 1
- S3.Looped = false
- S3:Play()
- end)
- game:GetService("RunService").Heartbeat:Connect(function()
- lazer.CFrame = handle.CFrame * CFrame.new(0, 1.76, 0)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement