Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Script made by: Kezoto
- Date: 2021-03-16
- It is forbidden to use/have the code without my consent.
- --]]
- local PhysicsService = game:GetService("PhysicsService")
- local CanUse = true
- local CollisionsAre = true
- players = PhysicsService:CreateCollisionGroup("Players")
- Nonplayers = PhysicsService:CreateCollisionGroup("NonPlayers")
- PhysicsService:CollisionGroupSetCollidable("Players", "Players", true)
- PhysicsService:CollisionGroupSetCollidable("Players", "NonPlayers", true)
- PhysicsService:CollisionGroupSetCollidable("NonPlayers", "NonPlayers", false)
- PhysicsService:CollisionGroupSetCollidable("NonPlayers", "Players", false)
- game.Players.PlayerAdded:Connect(function(player)
- local rank = player:GetRankInGroup(9552807)
- player.CharacterAdded:Connect(function(char)
- if CollisionsAre == true then
- repeat wait (1) until char:WaitForChild("Humanoid")
- for _, characterPart in pairs (char:GetChildren()) do
- if characterPart:IsA("BasePart") then
- PhysicsService:SetPartCollisionGroup(characterPart, "Players")
- end
- end
- elseif CollisionsAre == false then
- repeat wait (1) until char:WaitForChild("Humanoid")
- for _, characterPart in pairs (char:GetChildren()) do
- if characterPart:IsA("BasePart") then
- PhysicsService:SetPartCollisionGroup(characterPart, "NonPlayers")
- end
- end
- end
- player.Chatted:Connect(function(msg)
- local Loweredmsg = msg:lower()
- local splitMessage = msg:split(" ")
- if splitMessage[1] and splitMessage[2] and splitMessage[3] and splitMessage[1] == "!c" and splitMessage[2] == "on" and rank >= 235 then
- if game.Players:FindFirstChild(splitMessage[3]) then
- local charToOn = game.Players:FindFirstChild(splitMessage[3]).Character
- repeat wait (.1) until char:WaitForChild("Humanoid")
- for _, characterPart in pairs (charToOn:GetChildren()) do
- if characterPart:IsA("BasePart") then
- PhysicsService:SetPartCollisionGroup(characterPart, "NonPlayers")
- end
- end
- end
- elseif splitMessage[1] and splitMessage[2] and splitMessage[3] and splitMessage[1] == "!c" and splitMessage[2] == "off" and rank >= 235 then
- if game.Players:FindFirstChild(splitMessage[3]) then
- local charToOn = game.Players:FindFirstChild(splitMessage[3]).Character
- repeat wait (.1) until char:WaitForChild("Humanoid")
- for _, characterPart in pairs (charToOn:GetChildren()) do
- if characterPart:IsA("BasePart") then
- PhysicsService:SetPartCollisionGroup(characterPart, "Players")
- end
- end
- end
- end
- if Loweredmsg == "!c on" and CanUse == true then
- repeat wait (.1) until char:WaitForChild("Humanoid")
- for _, characterPart in pairs (char:GetChildren()) do
- if characterPart:IsA("BasePart") then
- PhysicsService:SetPartCollisionGroup(characterPart, "NonPlayers")
- end
- end
- elseif Loweredmsg == "!c off" and CanUse == true then
- repeat wait (.1) until char:WaitForChild("Humanoid")
- for _, characterPart in pairs (char:GetChildren()) do
- if characterPart:IsA("BasePart") then
- PhysicsService:SetPartCollisionGroup(characterPart, "Players")
- end
- end
- elseif Loweredmsg == "!c on all" and rank >= 235 then
- CollisionsAre = true
- for _,plr in ipairs(game:GetService("Players"):GetPlayers())do
- if plr and plr.Character then
- for _, characterPart in ipairs (plr.Character:GetChildren()) do
- if characterPart:IsA("BasePart") then
- PhysicsService:SetPartCollisionGroup(characterPart, "NonPlayers")
- end
- end
- end
- end
- elseif Loweredmsg == "!c off all" and rank >= 235 then
- CollisionsAre = false
- for _,plr in ipairs(game:GetService("Players"):GetPlayers())do
- if plr and plr.Character then
- for _, characterPart in ipairs (plr.Character:GetChildren()) do
- if characterPart:IsA("BasePart") then
- PhysicsService:SetPartCollisionGroup(characterPart, "Players")
- end
- end
- end
- end
- elseif Loweredmsg == "!c turn on" and rank >= 235 then
- CanUse = true
- elseif Loweredmsg == "!c turn off" and rank >= 235 then
- CanUse = false
- end
- end)
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement