Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. local ts = game:GetService("TweenService")
  2. local info = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
  3. script.Parent.OnServerEvent:Connect(function(plr)
  4. local chr = plr.Character
  5. local genjutsu = game.ReplicatedStorage.TimeStopGenjutsu:Clone()
  6. genjutsu.Parent = chr.HumanoidRootPart
  7. genjutsu.Position = chr.HumanoidRootPart.Position
  8. local prop = {
  9. Size = Vector3.new(179.39, 179.39, 179.39)
  10. }
  11. local tween = ts:Create(genjutsu, info, prop)
  12. tween:Play()
  13. local e = script.Parent.Parent.GenjutsuSound:Clone()
  14. e.Parent = workspace
  15. e:Play()
  16. wait(2)
  17. local pos1, pos2 = (genjutsu.Position - (genjutsu.Size / 2)), (genjutsu.Position + (genjutsu.Size / 2))
  18. local R3 = Region3.new(pos1, pos2)
  19. print("1")
  20. wait(1)
  21. print("2")
  22. local RecordedParts = {}
  23. for _, Part in pairs(game.Workspace:FindPartsInRegion3(R3, nil, math.huge)) do
  24. print("||||"..Part.Name.."|||||||")
  25. if Part:IsA("Model") and Part:FindFirsrChild("Humanoid") then
  26. print(Part.Name.." is currently in the region")
  27. RecordedParts[Part.Name] = true
  28. end
  29. end
  30. while wait(1) do
  31. print("-----------------------------------")
  32. print("3")
  33. local ReturnedParts = game.Workspace:FindPartsInRegion3(R3, nil, math.huge)
  34. local ReformattedReturned = {}
  35.  
  36. for key,Part in pairs(RecordedParts) do
  37. print(key.." is what in the RecordedParts array ")
  38. ReformattedReturned[key] = false
  39. end
  40. print("-----------------------------------")
  41. print("4")
  42. for _, Part in pairs(ReturnedParts) do
  43. print("||||"..Part.Name.."|||||||")
  44. if Part:IsA("Model") and Part:FindFirsrChild("Humanoid") then
  45. print(Part.Name.." is currently in the region when looping")
  46. ReformattedReturned[Part.Name] = true
  47. end
  48. end
  49. print("-----------------------------------")
  50. print("5")
  51. for Character, value in pairs(RecordedParts) do
  52. print("||||"..Character.."|||||||")
  53. if Character == chr.Name then
  54. print("2||||2 "..Character.." 2|||||||2")
  55. if not ReformattedReturned[Character] then
  56. print(Character.." has left the Region3!")
  57. RecordedParts[Character] = false -- Removes parts that have exited
  58. end
  59. end
  60. end
  61.  
  62. for _, Part in pairs(ReturnedParts) do
  63. RecordedParts[Part.Name] = true
  64. end
  65. print("-----------------------------------")
  66. end
  67. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement