Advertisement
ZOUK_AG

Roblox Studio toolHandler Scripts

Jun 1st, 2020
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. --[[
  2.  
  3. ZOUK AG 유튜브 구독해주세요^^
  4.  
  5. --]]
  6.  
  7. local re = Instance.new("RemoteEvent")
  8. re.Parent = game:GetService("ReplicatedStorage")
  9. re.Name = "toolEvent"
  10.  
  11. re.OnServerEvent:Connect(function(plr, tool)
  12. local mag = (tool:WaitForChild("Handle").Position - plr.Character.HumanoidRootPart.Position).magnitude
  13.  
  14. if mag < 5 then
  15. tool.Parent = plr.Backpack
  16. end
  17. end)
  18.  
  19. function untouch(list)
  20. for i = 1, #list do
  21. local handle = list[i]:WaitForChild("Handle")
  22. if handle then
  23. local ti = handle:FindFirstChild("antiTouch") -- <
  24. if not ti then
  25. local clone = script.antiTouch:Clone() -- <
  26. clone.Parent = handle
  27. clone.Disabled = false
  28. end
  29. end
  30. end
  31. end
  32.  
  33. local tools = workspace:WaitForChild("tools"):GetChildren()
  34. untouch(tools)
  35.  
  36. workspace.tools.ChildAdded:Connect(function(child)
  37. untouch({child})
  38. end)
  39.  
  40. workspace.ChildAdded:Connect(function(child)
  41. if child:IsA("Tool") then
  42. wait()
  43. child.Parent = workspace.tools
  44. end
  45. end)
  46.  
  47. --[[ 스크립트 제작자 ZOUK AG ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement