Advertisement
p0vdnot

Diamond Sword V.1

Dec 3rd, 2019
515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. local tool = Instance.new("Tool")
  2. tool.Name = "Diamond Sword"
  3. tool.Parent = owner.Backpack
  4. tool.GripForward = Vector3.new(0.73, -0.039, 0.683)
  5. tool.GripPos = Vector3.new(-1.345, 0.124, 1.189)
  6. tool.GripRight = Vector3.new(0.029, 0.999, 0.025)
  7. tool.GripUp = Vector3.new(0.683, -0.002, -0.73)
  8.  
  9. local handle = Instance.new("Part")
  10. handle.Name = "Handle"
  11. handle.Parent = tool
  12. handle.Size = Vector3.new(2,1,4)
  13.  
  14. local mesh = Instance.new("SpecialMesh")
  15. mesh.Parent = handle
  16. mesh.MeshId = "rbxassetid://3676810102"
  17. mesh.MeshType = Enum.MeshType.FileMesh
  18. mesh.Scale = Vector3.new(0.25,0.25,0.25)
  19. mesh.TextureId = "rbxassetid://3676810220"
  20.  
  21. tool.Equipped:Connect(function()
  22.  
  23. end)
  24.  
  25. tool.Activated:Connect(function()
  26. if not clicked then
  27. clicked = true
  28. tool.GripForward = Vector3.new(0.718, -0.039, -0.694)
  29. tool.GripPos = Vector3.new(-1.267, 0.124, 1.298)
  30. tool.GripRight = Vector3.new(0.027, 0.999, -0.028)
  31. tool.GripUp = Vector3.new(-0.695, -0.002, -0.719)
  32.  
  33. wait(.5)
  34.  
  35. clicked = false
  36.  
  37. tool.GripForward = Vector3.new(0.73, -0.039, 0.683)
  38. tool.GripPos = Vector3.new(-1.345, 0.124, 1.189)
  39. tool.GripRight = Vector3.new(0.029, 0.999, 0.025)
  40. tool.GripUp = Vector3.new(0.683, -0.002, -0.73)
  41. end
  42. end)
  43.  
  44. function onHit(hit)
  45. if clicked and hit.Parent:FindFirstChild("Humanoid") then
  46. if hit.Parent:FindFirstChild("Humanoid").Health >0 then
  47. clicked = false
  48. local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
  49. local hum = hit.Parent.Humanoid
  50. hum.Health = 0
  51.  
  52. local OOF = Instance.new("Sound")
  53. OOF.Name = "OOF"
  54. OOF.Parent = hit
  55. OOF.SoundId = "rbxassetid://3362346832"
  56. OOF.Volume = 10
  57. OOF:Play()
  58.  
  59. local gui = Instance.new("ScreenGui")
  60.  
  61. if plr and hum.Health <=0 then
  62. gui.Name = "You Died!"
  63. gui.Parent = plr.PlayerGui
  64. gui.ResetOnSpawn = false
  65.  
  66. for i,v in pairs(hit.Parent:GetDescendants()) do
  67. if v:IsA("UnionOperation") or v:IsA("Part") then
  68. v.BrickColor = BrickColor.new("Really red")
  69. elseif v:IsA("SpecialMesh") then
  70. v.TextureId = "rbxassetid://102397435"
  71. elseif v:IsA("Shirt") or v:IsA("Pants") then
  72. v:Destroy()
  73. end
  74. end
  75.  
  76. local frame = Instance.new("Frame")
  77. frame.Name = "Red"
  78. frame.Parent = gui
  79. frame.BackgroundColor3 = Color3.fromRGB(255,0,0)
  80. frame.BackgroundTransparency = 0.5
  81. frame.BorderSizePixel = 0
  82. frame.Size = UDim2.new(1,0,1,36)
  83. frame.Position = UDim2.new(0,0,0,-36)
  84.  
  85. local imagelab = Instance.new("ImageLabel")
  86. imagelab.Name = "You_Died"
  87. imagelab.Parent = gui
  88. imagelab.Size = UDim2.new(1,0,1,36)
  89. imagelab.Position = UDim2.new(0,0,0,-36)
  90. imagelab.BackgroundTransparency = 1
  91. imagelab.Image = "rbxassetid://4485065696"
  92.  
  93. wait(5)
  94. gui:Destroy()
  95. end
  96. end
  97. end
  98. end
  99. handle.Touched:Connect(onHit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement