Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local hitboxName = "HumanoidRootPart"
- local hitboxCollides = false
- local hitboxTransparency = 0
- local hitboxSizeLarge = Vector3.new(20, 20, 1)
- local hitboxSizeNormal = Vector3.new(2, 2, 1)
- local players = game:GetService("Players")
- local runService = game:GetService("RunService")
- local inputService = game:GetService("UserInputService")
- local player = players.LocalPlayer
- local properties = {
- CanCollide = hitboxCollides,
- Transparency = hitboxTransparency,
- Size = hitboxSizeLarge,
- }
- runService.Heartbeat:connect(function()
- local character = player.Character
- local rootPart = character and character.PrimaryPart
- local hitboxPosition = rootPart and (rootPart.Position + Vector3.new(0,0,6))
- if typeof(hitboxPosition) ~= "Vector3" then
- return
- end
- for _, otherPlayer in pairs(players:GetPlayers()) do
- if otherPlayer ~= player then
- local character = otherPlayer.Character
- if character and character.Parent then
- local hitbox = character:FindFirstChild(hitboxName)
- if hitbox and hitbox:IsA("BasePart") then
- for property, value in pairs(properties) do
- hitbox[property] = value
- end
- hitbox.Position = hitboxPosition
- end
- end
- end
- end
- end)
- inputService.InputBegan:connect(function(input, wasProcessed)
- if wasProcessed then return end
- if input.UserInputType == Enum.UserInputType.Keyboard then
- if input.KeyCode == Enum.KeyCode.H then
- if properties.Size == hitboxSizeLarge then
- properties.Size = hitboxSizeNormal
- else
- properties.Size = hitboxSizeLarge
- end
- elseif input.KeyCode == Enum.KeyCode.J then
- properties.CanCollide = not properties.CanCollide
- elseif input.KeyCode == Enum.KeyCode.K then
- properties.Transparency = math.clamp(properties.Transparency - 0.1, 0, 1)
- elseif input.KeyCode == Enum.KeyCode.L then
- properties.Transparency = math.clamp(properties.Transparency + 0.1, 0, 1)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement