Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Credits to Rex (C/E)#9115
- -- Global Hitbox Expander (Players & NPCs)
- -- I'm not gonna make this a GUI because it'll be easier to patch, sorry :(
- -- Updated 2/5/2022, Exact time 1:04 AM PST
- -- Update: Major overhaul. Changed the sussy chat variant to the least sussy keybind version. Additionally made it so that this script has a passive nocollide for all players and npcs (experimental)
- local players = game:GetService("Players")
- local plr = players.LocalPlayer
- local mouse = plr:GetMouse()
- local workspace = game:GetService("Workspace")
- local Size = 5 -- Change this number to the stud range in width, length, and height you want it to be. One number because its used for all axis.
- local Repeat = true -- Change it to make it repeat or not (if its repeating, it might lag a bit. but manually changing it can be annoying too)
- local RenderStepped = game:GetService("RunService").RenderStepped -- Dont mess with this
- local PhysicsService = game:GetService("PhysicsService") -- Dont mess with this
- local EnableWithHotkey = true -- Enable Hotkey
- local NonExpandingHeadSize = 1 -- For when you arent expanding
- local NPCSArea = workspace -- Where to get NPCS
- local PlayersArea = workspace -- Where to get Players
- local KeyToEnable = "[" -- The hotkey to begin expanding
- local NPCExtend = false -- Weather or not to hitbox expand none player entities
- local PlayerExtend = true -- Weather or not to hitbox extend player characters
- local ResetHeadsOnDisable = true -- Resets the heads back to their non expanding sizes. Temporary feature.
- local RepeatCooldown = 5
- local Debounce = false
- local ExpandPart = "Head"
- ------------------------------------- !!DISABLED Simple No Collisions DISABLED!! ---------------------------------
- --[[
- local playerCollisionGroupName = "Entities"
- PhysicsService:CreateCollisionGroup(playerCollisionGroupName)
- PhysicsService:CollisionGroupSetCollidable(playerCollisionGroupName, playerCollisionGroupName, false)
- local previousCollisionGroups = {}
- local function setCollisionGroup(object)
- if object:IsA("BasePart") then
- previousCollisionGroups[object] = object.CollisionGroupId
- PhysicsService:SetPartCollisionGroup(object, playerCollisionGroupName)
- end
- end
- local function setCollisionGroupRecursive(object)
- setCollisionGroup(object)
- for _, child in ipairs(object:GetChildren()) do
- setCollisionGroupRecursive(child)
- end
- end
- local function resetCollisionGroup(object)
- local previousCollisionGroupId = previousCollisionGroups[object]
- if not previousCollisionGroupId then return end
- local previousCollisionGroupName = PhysicsService:GetCollisionGroupName(previousCollisionGroupId)
- if not previousCollisionGroupName then return end
- PhysicsService:SetPartCollisionGroup(object, previousCollisionGroupName)
- previousCollisionGroups[object] = nil
- end
- local function onCharacterAdded(character)
- setCollisionGroupRecursive(character)
- character.DescendantAdded:Connect(setCollisionGroup)
- character.DescendantRemoving:Connect(resetCollisionGroup)
- end
- local function onPlayerAdded(player)
- player.CharacterAdded:Connect(onCharacterAdded)
- end
- players.PlayerAdded:Connect(onPlayerAdded)
- NPCSArea.ChildAdded:Connect(function(yes)
- if yes:IsA("Model") and yes:FindFirstChildOfClass("Humanoid") and not players:GetPlayerFromCharacter(yes) then
- onCharacterAdded(yes)
- end
- end)
- for i,v in ipairs(NPCSArea:GetDescendants()) do
- if v:IsA("Model") and v:FindFirstChildOfClass("Humanoid") and not players:GetPlayerFromCharacter(v) then
- onCharacterAdded(v)
- end
- end
- PlayersArea.ChildAdded:Connect(function(yes)
- if yes:IsA("Model") and yes:FindFirstChildOfClass("Humanoid") and players:GetPlayerFromCharacter(yes) then
- onCharacterAdded(yes)
- end
- end)
- for i,v in ipairs(PlayersArea:GetDescendants()) do
- if v:IsA("Model") and v:FindFirstChildOfClass("Humanoid") and players:GetPlayerFromCharacter(v) then
- onCharacterAdded(v)
- end
- end
- ]]
- ----------------------------------------------- Key Presses -------------------------------------------
- mouse.KeyDown:Connect(function(Key)
- if Key == KeyToEnable then
- print("Pressed")
- Repeat = not Repeat
- end
- end)
- ----------------------------------------------- Main Code ---------------------------------------------
- if Repeat then
- print("Repeating")
- RenderStepped:Connect(function()
- if Repeat and not Debounce then
- children = workspace:GetDescendants()
- entities = players:GetChildren()
- while Repeat do
- print("Expanding")
- Debounce = true
- children = workspace:GetDescendants()
- entities = players:GetChildren()
- wait(RepeatCooldown)
- if PlayerExtend then
- for i,v in pairs(entities) do
- if v.Name ~= players.LocalPlayer.Name then
- v.Character:WaitForChild(ExpandPart).Size = Vector3.new(Size,Size,Size)
- end
- end
- end
- if NPCExtend then
- for i,v in pairs(children) do
- if v.Name == ExpandPart and v.Parent:IsA("Model") and v.Parent:FindFirstChildOfClass("Humanoid") and not players:GetPlayerFromCharacter(v.Parent) then
- v.Size = Vector3.new(Size,Size,Size)
- end
- end
- end
- end
- children = workspace:GetDescendants()
- entities = players:GetChildren()
- if PlayerExtend then
- for i,v in pairs(entities) do
- if v.Name ~= players.LocalPlayer.Name then
- v.Character:WaitForChild(ExpandPart).Size = Vector3.new(NonExpandingHeadSize,NonExpandingHeadSize,NonExpandingHeadSize)
- end
- end
- end
- if NPCExtend then
- for i,v in pairs(children) do
- if v.Name == ExpandPart and v.Parent:IsA("Model") and v.Parent:FindFirstChildOfClass("Humanoid") and not players:GetPlayerFromCharacter(v.Parent) then
- v.Size = Vector3.new(NonExpandingHeadSize,NonExpandingHeadSize,NonExpandingHeadSize)
- end
- end
- end
- Debounce = false
- end
- if not Repeat and not Debounce then
- print("Disabled")
- children = workspace:GetDescendants()
- entities = players:GetChildren()
- while not Repeat do
- Debounce = true
- children = workspace:GetDescendants()
- entities = players:GetChildren()
- wait(RepeatCooldown)
- if PlayerExtend then
- for i,v in pairs(entities) do
- if v.Name ~= players.LocalPlayer.Name then
- v.Character:WaitForChild(ExpandPart).Size = Vector3.new(NonExpandingHeadSize,NonExpandingHeadSize,NonExpandingHeadSize)
- end
- end
- end
- if NPCExtend then
- for i,v in pairs(children) do
- if v.Name == ExpandPart and v.Parent:IsA("Model") and v.Parent:FindFirstChildOfClass("Humanoid") and not players:GetPlayerFromCharacter(v.Parent) then
- v.Size = Vector3.new(NonExpandingHeadSize,NonExpandingHeadSize,NonExpandingHeadSize)
- end
- end
- end
- end
- children = workspace:GetDescendants()
- entities = players:GetChildren()
- Debounce = false
- end
- end)
- else
- children = workspace:GetDescendants()
- entities = players:GetChildren()
- if PlayerExtend then
- for i,v in pairs(entities) do
- if v.Name ~= players.LocalPlayer.Name then
- v.Character:WaitForChild(ExpandPart).Size = Vector3.new(Size,Size,Size)
- end
- end
- end
- if NPCExtend then
- for i,v in pairs(children) do
- if v.Name == ExpandPart and v.Parent:IsA("Model") and v.Parent:FindFirstChildOfClass("Humanoid") and not players:GetPlayerFromCharacter(v.Parent) then
- v.Size = Vector3.new(Size,Size,Size)
- end
- end
- end
- end
- ------------------------------------------- End of Script -------------------------------------------
Add Comment
Please, Sign In to add comment