how to you make a damage part

Back
Gamingtime1
Join Date:
Posts:
Feb 2024
10
9 months ago | 28 • By Gamingtime1

how do i do it


Index
Join Date:
Posts:
Streak:
Sep 2019
910
7 days
9 months ago • By Index 7d

local Damage = 15
local DelayBetweenDamage = 0.5
local Debounce = true

script.Parent.Touched:Connect(function (collision)
if collision:IsA('Player') and Debounce == false then
Debounce = true
collision.Health = collision.Health - Damage
wait(DelayBetweenDamage)
Debounce = false
end
end)

Code was taken from PolyCode (collection of pre-made scripts, tutorials, and resources - made by me!)



hey, I'm Index!

Maxdj8000
Join Date:
Posts:
Streak:
Apr 2023
414
107 days
8 months ago • By Maxdj8000 107d
Index
Index 9 months ago
``` local Damage = 15 local DelayBetweenDamage = 0.5 local Debounce = true script.Parent.Touched:Connect(function (collision) if collision:IsA('Player') and Debounce == false then Debounce = true collision.Health = collision.Health - Damage wait(DelayBetweenDamage) Debounce = false end end) ``` Code was taken from PolyCode (collection of pre-made scripts, tutorials, and resources - made by me!)

thx! ima use this in an up coming obby im making!



Ho ho homies get in focus then take notice! I'm what is oh yeah that show biz!