local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local mouse = player:GetMouse()
function onTouch(otherPart)
local character = otherPart.parent
if character then
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid:TakeDamage(25)
end
end
end
function m1()
local humanoidRoot = character:WaitForChild("HumanoidRootPart")
local playerSize = character:GetExtentsSize()
local hitbox = Instance.new("Part")
hitbox.Parent = workspace
hitbox.Size = Vector3.new(playerSize.X, playerSize.Y, 10)
hitbox.CFrame = humanoidRoot.CFrame * CFrame.new(0, 0, -10)
hitbox.Name = player.Name .. "'s m1 Hitbox"
hitbox.Color = BrickColor.Red()
hitbox.Material = Enum.Material.ForceField
hitbox.CanCollide = false
hitbox.Anchored = true
hitbox.Touched:Connect(onTouch)
task.wait(1)
hitbox:Destroy()
end
function generateHitboxes()
for hitboxesGenerated = 1, 20 do
m1()
task.wait(0.05)
end
end
mouse.Button1Down:Connect(generateHitboxes)
Can someone help me? This is experimental so ill do immunity and a local version later, but for now, i put this in ServerScriptService and it just doesn't do anything. I also tried a local script in starterplayerscripts but then it just ignores the color, material, can collide, anchored or auto-destroy.
** You are now Level 3! **