SHARE
TWEET

xlib.rw.playertool

a guest Mar 23rd, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Instances:
  2. local Players = game:GetService("Players")
  3.  
  4. local localPlayer = Players.LocalPlayer
  5. local backpack = localPlayer:WaitForChild("Backpack")
  6.  
  7. local tool = Instance.new("Tool")
  8. tool.RequiresHandle = false
  9. tool.CanBeDropped = true
  10. tool.Parent = backpack
  11. tool.Name = "Click\r\nKill"
  12.  
  13. local mode = "kill"
  14.  
  15. local ToolUI = Instance.new("ScreenGui")
  16. local Frame = Instance.new("Frame")
  17. local TextButton = Instance.new("TextButton")
  18. --Properties:
  19. ToolUI.Name = "ToolUI"
  20. ToolUI.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  21.  
  22. TextButton.Parent = ToolUI
  23. TextButton.BackgroundColor3 = Color3.new(0.129412, 0.129412, 0.129412)
  24. TextButton.BackgroundTransparency = 0.3
  25. TextButton.Position = UDim2.new(0.855, 0, 0.96, 0)
  26. TextButton.Size = UDim2.new(0, 170, 0, 23)
  27. TextButton.Font = Enum.Font.SourceSans
  28. TextButton.Text = "Mode: Kill"
  29. TextButton.TextColor3 = Color3.new(1, 1, 1)
  30. TextButton.TextSize = 14
  31. TextButton.Visible = false
  32. TextButton.Active = true
  33. TextButton.Draggable = true
  34. TextButton.Selectable = true
  35. -- Scripts:
  36.  
  37.  
  38. tool.Equipped:Connect(function(mouse)
  39.     TextButton.Visible = true
  40.     mouse.Button1Down:Connect(function()
  41.         if mouse.Target and mouse.Target.Parent then
  42.             local char = Players:GetPlayerFromCharacter(mouse.Target.Parent)
  43.             if char == nil then return end
  44.             if(char.ClassName == "Player") then
  45.                 if mode == "kill" then
  46.                     game.Workspace.resources.RemoteEvent:FireServer("dealDamage", char.Character.Humanoid, 100)
  47.                 elseif mode == "tase" then
  48.                     game.Workspace.resources.RemoteEvent:FireServer("tase", char)
  49.                 elseif mode == "arrest" then
  50.                     game.Workspace.resources.RemoteEvent:FireServer("cuff", char)
  51.                 end
  52.             end
  53.         end
  54.     end)
  55. end)
  56.  
  57. tool.Unequipped:Connect(function()
  58.     TextButton.Visible = false
  59. end)
  60. TextButton.MouseButton1Click:Connect(function()
  61.     if(mode == "kill") then
  62.         mode = "tase"
  63.         TextButton.Text = "Mode: Tase"
  64.         tool.Name = "Click\r\nTase"
  65.     elseif(mode == "tase") then
  66.         mode = "arrest"
  67.         TextButton.Text = "Mode: Arrest"
  68.         tool.Name = "Click\r\nArrest"
  69.     elseif(mode == "arrest") then
  70.         mode = "kill"
  71.         TextButton.Text = "Mode: Kill"
  72.         tool.Name = "Click\r\nKill"
  73.     end
  74. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top