Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local d = true
- script.Parent.Touched:Connect(function(hit)
- local p = game.Players:GetPlayerFromCharacter(hit:FindFirstAncestorOfClass("Model"))
- if p then
- if d == true then
- d = false
- local toolname = "Rifle"
- local char = hit:GetFirstAncestorOfClass("Model")
- local player = game.Players:GetPlayerFromCharacter(char)
- if player.Backpack:FindFirstChild(toolname) or char:FindFirstChild(toolname) then
- repeat
- player.Backpack:FindFirstChild(toolname):Destroy()
- char:FindFirstChild(toolname):Destroy()
- until not char:FindFirstChild(toolname) and not player.Backpack:FindFirstChild(toolname)
- end
- if not p.Backpack:FindFirstChild("Laser Rifle") then
- game.ServerStorage["Laser Rifle"]:Clone().Parent = p.Backpack
- end
- wait(10)
- local nametool = "Laser Rifle"
- local char = hit:GetFirstAncestorOfClass("Model")
- local player = game.Players:GetPlayerFromCharacter(char)
- if player.Backpack:FindFirstChild(nametool) or char:FindFirstChild(nametool) then
- repeat
- player.Backpack:FindFirstChild(nametool):Destroy()
- char:FindFirstChild(nametool):Destroy()
- until not char:FindFirstChild(nametool) and not player.Backpack:FindFirstChild(nametool)
- end
- if not p.Backpack:FindFirstChild("Rifle") then
- game.ServerStorage["Rifle"]:Clone().Parent = p.Backpack
- end
- end
- end
- wait(110)
- d = true
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement