Advertisement
Kezoto

It is forbidden to use/have the code without my consent.

Mar 16th, 2021
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1. --[[
  2. Script made by: Kezoto
  3. Date: 2021-03-16
  4. It is forbidden to use/have the code without my consent.
  5. --]]
  6. local PhysicsService = game:GetService("PhysicsService")
  7. local CanUse = true
  8. local CollisionsAre = true
  9. players = PhysicsService:CreateCollisionGroup("Players")
  10. Nonplayers = PhysicsService:CreateCollisionGroup("NonPlayers")
  11.  
  12.  
  13. PhysicsService:CollisionGroupSetCollidable("Players", "Players", true)
  14. PhysicsService:CollisionGroupSetCollidable("Players", "NonPlayers", true)
  15. PhysicsService:CollisionGroupSetCollidable("NonPlayers", "NonPlayers", false)
  16. PhysicsService:CollisionGroupSetCollidable("NonPlayers", "Players", false)
  17.  
  18. game.Players.PlayerAdded:Connect(function(player)
  19. local rank = player:GetRankInGroup(9552807)
  20. player.CharacterAdded:Connect(function(char)
  21. if CollisionsAre == true then
  22. repeat wait (1) until char:WaitForChild("Humanoid")
  23. for _, characterPart in pairs (char:GetChildren()) do
  24. if characterPart:IsA("BasePart") then
  25. PhysicsService:SetPartCollisionGroup(characterPart, "Players")
  26. end
  27. end
  28. elseif CollisionsAre == false then
  29. repeat wait (1) until char:WaitForChild("Humanoid")
  30. for _, characterPart in pairs (char:GetChildren()) do
  31. if characterPart:IsA("BasePart") then
  32. PhysicsService:SetPartCollisionGroup(characterPart, "NonPlayers")
  33. end
  34. end
  35. end
  36. player.Chatted:Connect(function(msg)
  37. local Loweredmsg = msg:lower()
  38. local splitMessage = msg:split(" ")
  39. if splitMessage[1] and splitMessage[2] and splitMessage[3] and splitMessage[1] == "!c" and splitMessage[2] == "on" and rank >= 235 then
  40. if game.Players:FindFirstChild(splitMessage[3]) then
  41. local charToOn = game.Players:FindFirstChild(splitMessage[3]).Character
  42. repeat wait (.1) until char:WaitForChild("Humanoid")
  43. for _, characterPart in pairs (charToOn:GetChildren()) do
  44. if characterPart:IsA("BasePart") then
  45. PhysicsService:SetPartCollisionGroup(characterPart, "NonPlayers")
  46. end
  47. end
  48. end
  49. elseif splitMessage[1] and splitMessage[2] and splitMessage[3] and splitMessage[1] == "!c" and splitMessage[2] == "off" and rank >= 235 then
  50. if game.Players:FindFirstChild(splitMessage[3]) then
  51. local charToOn = game.Players:FindFirstChild(splitMessage[3]).Character
  52. repeat wait (.1) until char:WaitForChild("Humanoid")
  53. for _, characterPart in pairs (charToOn:GetChildren()) do
  54. if characterPart:IsA("BasePart") then
  55. PhysicsService:SetPartCollisionGroup(characterPart, "Players")
  56. end
  57. end
  58. end
  59. end
  60. if Loweredmsg == "!c on" and CanUse == true then
  61. repeat wait (.1) until char:WaitForChild("Humanoid")
  62. for _, characterPart in pairs (char:GetChildren()) do
  63. if characterPart:IsA("BasePart") then
  64. PhysicsService:SetPartCollisionGroup(characterPart, "NonPlayers")
  65. end
  66. end
  67. elseif Loweredmsg == "!c off" and CanUse == true then
  68. repeat wait (.1) until char:WaitForChild("Humanoid")
  69. for _, characterPart in pairs (char:GetChildren()) do
  70. if characterPart:IsA("BasePart") then
  71. PhysicsService:SetPartCollisionGroup(characterPart, "Players")
  72. end
  73. end
  74. elseif Loweredmsg == "!c on all" and rank >= 235 then
  75. CollisionsAre = true
  76. for _,plr in ipairs(game:GetService("Players"):GetPlayers())do
  77. if plr and plr.Character then
  78. for _, characterPart in ipairs (plr.Character:GetChildren()) do
  79. if characterPart:IsA("BasePart") then
  80. PhysicsService:SetPartCollisionGroup(characterPart, "NonPlayers")
  81. end
  82. end
  83. end
  84. end
  85. elseif Loweredmsg == "!c off all" and rank >= 235 then
  86. CollisionsAre = false
  87. for _,plr in ipairs(game:GetService("Players"):GetPlayers())do
  88. if plr and plr.Character then
  89. for _, characterPart in ipairs (plr.Character:GetChildren()) do
  90. if characterPart:IsA("BasePart") then
  91. PhysicsService:SetPartCollisionGroup(characterPart, "Players")
  92. end
  93. end
  94. end
  95. end
  96. elseif Loweredmsg == "!c turn on" and rank >= 235 then
  97. CanUse = true
  98. elseif Loweredmsg == "!c turn off" and rank >= 235 then
  99. CanUse = false
  100. end
  101. end)
  102. end)
  103. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement