Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tool = Instance.new("Tool")
- tool.Name = "Diamond Sword"
- tool.Parent = owner.Backpack
- tool.GripForward = Vector3.new(0.73, -0.039, 0.683)
- tool.GripPos = Vector3.new(-1.345, 0.124, 1.189)
- tool.GripRight = Vector3.new(0.029, 0.999, 0.025)
- tool.GripUp = Vector3.new(0.683, -0.002, -0.73)
- local handle = Instance.new("Part")
- handle.Name = "Handle"
- handle.Parent = tool
- handle.Size = Vector3.new(2,1,4)
- local mesh = Instance.new("SpecialMesh")
- mesh.Parent = handle
- mesh.MeshId = "rbxassetid://3676810102"
- mesh.MeshType = Enum.MeshType.FileMesh
- mesh.Scale = Vector3.new(0.25,0.25,0.25)
- mesh.TextureId = "rbxassetid://3676810220"
- tool.Equipped:Connect(function()
- end)
- tool.Activated:Connect(function()
- if not clicked then
- clicked = true
- tool.GripForward = Vector3.new(0.718, -0.039, -0.694)
- tool.GripPos = Vector3.new(-1.267, 0.124, 1.298)
- tool.GripRight = Vector3.new(0.027, 0.999, -0.028)
- tool.GripUp = Vector3.new(-0.695, -0.002, -0.719)
- wait(.5)
- clicked = false
- tool.GripForward = Vector3.new(0.73, -0.039, 0.683)
- tool.GripPos = Vector3.new(-1.345, 0.124, 1.189)
- tool.GripRight = Vector3.new(0.029, 0.999, 0.025)
- tool.GripUp = Vector3.new(0.683, -0.002, -0.73)
- end
- end)
- function onHit(hit)
- if clicked and hit.Parent:FindFirstChild("Humanoid") then
- if hit.Parent:FindFirstChild("Humanoid").Health >0 then
- clicked = false
- local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
- local hum = hit.Parent.Humanoid
- hum.Health = 0
- local OOF = Instance.new("Sound")
- OOF.Name = "OOF"
- OOF.Parent = hit
- OOF.SoundId = "rbxassetid://3362346832"
- OOF.Volume = 10
- OOF:Play()
- local gui = Instance.new("ScreenGui")
- if plr and hum.Health <=0 then
- gui.Name = "You Died!"
- gui.Parent = plr.PlayerGui
- gui.ResetOnSpawn = false
- for i,v in pairs(hit.Parent:GetDescendants()) do
- if v:IsA("UnionOperation") or v:IsA("Part") then
- v.BrickColor = BrickColor.new("Really red")
- elseif v:IsA("SpecialMesh") then
- v.TextureId = "rbxassetid://102397435"
- elseif v:IsA("Shirt") or v:IsA("Pants") then
- v:Destroy()
- end
- end
- local frame = Instance.new("Frame")
- frame.Name = "Red"
- frame.Parent = gui
- frame.BackgroundColor3 = Color3.fromRGB(255,0,0)
- frame.BackgroundTransparency = 0.5
- frame.BorderSizePixel = 0
- frame.Size = UDim2.new(1,0,1,36)
- frame.Position = UDim2.new(0,0,0,-36)
- local imagelab = Instance.new("ImageLabel")
- imagelab.Name = "You_Died"
- imagelab.Parent = gui
- imagelab.Size = UDim2.new(1,0,1,36)
- imagelab.Position = UDim2.new(0,0,0,-36)
- imagelab.BackgroundTransparency = 1
- imagelab.Image = "rbxassetid://4485065696"
- wait(5)
- gui:Destroy()
- end
- end
- end
- end
- handle.Touched:Connect(onHit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement