Galactix Posted June 29, 2018 Share Posted June 29, 2018 Hello, it's been a while since I tried to use the extrahealth resource made by Solidsnake14, but I can't manage to get it working. addEvent( "onZombieSpawn", true ) function RanSpawn_Z ( gx, gy, gz, rot) local safezone = 0 local allradars = getElementsByType("radararea") if getElementData(theRadar, "zombieProof") == true then for theKey,theRadar in ipairs(allradars) do if isInsideRadarArea ( theRadar, gx, gy ) then safezone = 1 end end end if safezone == 0 then if table.getn ( everyZombie ) < newZombieLimit then if not rot then rot = math.random (1,359) end randomZskin = math.random ( 1, table.getn ( ZombiePedSkins ) ) local zomb = createPed( tonumber( ZombiePedSkins[randomZskin] ), gx, gy, gz ) if zomb ~= false then setElementData ( zomb, "zombie", true ) exports.extrahealth:setElementExtraHealth(zomb, 10000) table.insert( everyZombie, zomb ) setTimer ( function (zomb, rot) if ( isElement ( zomb ) ) then setPedRotation ( zomb, rot ) end end, 500, 1, zomb, rot ) setTimer ( function (zomb) if ( isElement ( zomb ) ) then setPedAnimation ( zomb, "ped", chaseanim, -1, true, true, true ) end end, 1000, 1, zomb ) setTimer ( function (zomb) if ( isElement ( zomb ) ) then setElementData ( zomb, "status", "idle" ) end end, 2000, 1, zomb ) triggerClientEvent ( "Zomb_STFU", getRootElement(), zomb ) end end end end addEventHandler( "onZombieSpawn", getRootElement(), RanSpawn_Z ) I don't get any error from the script, but the zombies keep having 100 hp. If someone knows what I'm doing wrong I'd gladly apreciate to know what it is. For those who wonder, the function is exported in the meta file properly. Link to comment
Discord Moderators Pirulax Posted June 30, 2018 Discord Moderators Share Posted June 30, 2018 First of all, remove unnecessary expressions (== true, ~= false) like this: --// THis if getElementData(theRadar, "zombieProof") == true then end --// To this if getElementData(theRadar, "zombieProof") then end --// And this: if zomb ~= false then end --// To this if zomb then end Other than that, i cant help you, because i dont know how does that 'extrahealth' resource works. 2 Link to comment
Galactix Posted July 5, 2018 Author Share Posted July 5, 2018 Up because problem not solved Link to comment
Discord Moderators Pirulax Posted July 7, 2018 Discord Moderators Share Posted July 7, 2018 Did /debugscript 3 throw errors? Link to comment
Galactix Posted July 8, 2018 Author Share Posted July 8, 2018 Nope. It just says that the resource isn't started if I don't start the extrahealth script but when I turn it on it just doesn't throw any error related to it. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now