Jump to content

im blind af


kewizzle

Recommended Posts

addEventHandler("onZombieSpawned",root, 
function ( ) 
  setElementHealth ( source, math.random(10, 150 ) )
		if getElementHealth(source) >= 10 and getElementHealth(source) <= 50 then
			setElementData(source, "easy", true)
		elseif getElementHealth(source) >= 51 and getElementHealth(source) <= 69 then
			setElementData(source, "medium", true)
		elseif getElementHealth(source) > 70 then
			setElementData(source, "hard", true)
	end
		if getElementData(source, "easy", true) then
			setElementHealth(source, 50)
		elseif getElementData(source, "medium", true) then
			setElementHealth(source, 100)
		elseif getElementData(source, "hard", true) then
			setElementHealth(source, 150)
		end
 end)

sooo idk if im blind or stupid prolly a lil of both but i coded this from scratch twice and took 2 different approaches and neither worked right but they came close. yes i have a reason for elementdata they direct to what difficulty a zombie is by a colored dot but that aint my issue that all works but for some reason "easy" has the health of "hard" and they both have the same 150 health but medium is correct and only has 100 health. How do i make easy work and only have 50 health?

Link to comment
addEventHandler("onZombieSpawned",root, 
function ( ) 
  setElementHealth ( source, math.random(10, 150 ) )
	if getElementHealth(source) <= 49 then
		setElementData(source, "medium", true)
		setElementHealth(source, 25)
	elseif getElementHealth(source) >= 50 and getElementHealth(source) <= 99 then
		setElementData(source, "easy", true)
		setElementHealth(source, 75)
	elseif getElementHealth(source) >= 100 then
		setElementData(source, "hard", true)
		setElementHealth(source, 125)
	end
end)

fixed it :x

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...