#I take damage without touching the damage block
1 messages · Page 1 of 1 (latest)
local coffeeBlock = script.Parent
local Players = game:GetService("Players")
local cooldowns = {} -- debounce per player
coffeeBlock.Touched:Connect(function(hit)
local character = hit.Parent
local player = Players:GetPlayerFromCharacter(character)
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if humanoid and player then
if cooldowns[player] then return end -- prevent rapid hits
cooldowns[player] = true
-- Damage amount
humanoid:TakeDamage(20) -- reduces 20 HP (max is 100)
-- Cooldown before the same player can be damaged again
task.delay(0.5, function()
cooldowns[player] = nil
end)
end
end)
you have latge hitbox maybe
wht should i perchance do
accessories with CanTouch on maybe?
Meshpart with wonky hitboxes
Roblox is bad at calculating how things should interact with meshparts, and it often makes it so their hitboxes are misshapen and larger than they should be
Yeah and sometimes the hit box is a square part when the mesh is round