Advertisement
Guest User

The Script

a guest
Sep 21st, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.37 KB | None | 0 0
  1. local d = true
  2. script.Parent.Touched:Connect(function(hit)
  3.     local p = game.Players:GetPlayerFromCharacter(hit:FindFirstAncestorOfClass("Model"))
  4.     if p then
  5.         if d == true then
  6.             d = false
  7.             local toolname = "Rifle"
  8.             local char = hit:GetFirstAncestorOfClass("Model")
  9.             local player = game.Players:GetPlayerFromCharacter(char)
  10.             if player.Backpack:FindFirstChild(toolname) or char:FindFirstChild(toolname) then
  11.                 repeat
  12.                     player.Backpack:FindFirstChild(toolname):Destroy()
  13.                     char:FindFirstChild(toolname):Destroy()
  14.                 until not char:FindFirstChild(toolname) and not player.Backpack:FindFirstChild(toolname)
  15.             end
  16.             if not p.Backpack:FindFirstChild("Laser Rifle") then
  17.                 game.ServerStorage["Laser Rifle"]:Clone().Parent = p.Backpack
  18.             end
  19.             wait(10)
  20.             local nametool = "Laser Rifle"
  21.             local char = hit:GetFirstAncestorOfClass("Model")
  22.             local player = game.Players:GetPlayerFromCharacter(char)
  23.             if player.Backpack:FindFirstChild(nametool) or char:FindFirstChild(nametool) then
  24.                 repeat
  25.                     player.Backpack:FindFirstChild(nametool):Destroy()
  26.                     char:FindFirstChild(nametool):Destroy()
  27.                 until not char:FindFirstChild(nametool) and not player.Backpack:FindFirstChild(nametool)
  28.             end
  29.             if not p.Backpack:FindFirstChild("Rifle") then
  30.                 game.ServerStorage["Rifle"]:Clone().Parent = p.Backpack
  31.             end
  32.         end
  33.     end
  34.     wait(110)
  35.     d = true
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement