ADVERTISEMENTREMOVE ADS

Health System (take and sethealth) FOR SCRIPT DEVELOPERS!

Universal script
4 months ago
Script preview thumbnail
Script Preview

Description

this is a health system used to make the humanoid take damage if the player requires to take a certain amount of damage and settinghealth

ADVERTISEMENTREMOVE ADS
66 Lines • 1.46 KiB
Verified
Raw
local function gethealth()
return game.Players.LocalPlayer.Character.Humanoid.Health
end
local UseSettings = nil
if UseSettings == true then
getgenv().InfiniteHp = nil -- this is client sided and wont actually work
getgenv().HealthToTake = 0
getgenv().SetHealthTo = 0 -- change to desired health amount this is server sided
else
game.Players.LocalPlayer.Character.Humanoid.Health = gethealth()
end
local function checkall()
local plr = game.Players.LocalPlayer
local char = plr.Character
local humanoid = char.Humanoid
local hrp = humanoidRootPart
if plr and char and humanoid and hrp then
if not game:IsLoaded() then
repeat task.wait() until game:IsLoaded()
end
end
end
checkall()
local function sethealth(health)
game.Players.LocalPlayer.Character.Humanoid.Health = health
end
local function takehealth(health)
local plr = game.Players.LocalPlayer
local hum = plr.Character.Humanoid
local h = hum.Health
if plr and hum and h then
hum:TakeDamage(health)
end
end
local humanoidhealth = game.Players.LocalPlayer.Character.Humanoid.Health
humanoidhealth = gethealth()
local function infinitehp()
-- note this isnt real and will not work this is client sided
humanoidhealth = math.huge
end
takehealth(getgenv().HealthToTake)
if getgenv().SetHealthTo == 0 or nil then
humanoidhealth = gethealth()
else
sethealth(getgenv().SetHealthTo)
end
if getgenv().InfiniteHp then
infinitehp()
else
humanoidhealth = gethealth()
end
ADVERTISEMENTREMOVE ADS

Comments

9 comments
to add a comment
be

This is completely uselesss.

1
0
Wa

@beeswarmscript2 just like you

1
0
M3

@Waylon 🫤

0
0
Wa

@M3M3 what bro i take my scripts with heart

0
0
Hu

@Waylon damn bro got roasted 😂

1
0
Hu

@HunterXHunter is this only for script developers or can I also use it?

1
0
Wa

@HunterXHunter yeah you can its client sided though

0
0
Ax

whats the point

0
0
Wa

@Axiogenesis well someone asked what do i prefer hum takedamage or hum.Health = and i made ts

0
0
ADVERTISEMENTREMOVE ADS