I decided to make a health depletion script for a nuclear winter game. However, when I try to run it in game, nothing happens. I am a beginner and would appreciate if somebody told me what I am doing wrong.
local depletionAmount = 10
local function healthDeplete
local humanoid = character:FindFirstChild('Humanoid')
if humanoid then
local currentHealth = humanoid.Health
wait (1)
local newHealth = currentHealth - depletionAmount
humanoid.Health = newHealth
end
end

3 comments
Is this your entire script?
yes. it is the entire script
How do you get the character variable???