Search the Community
Showing results for tags 'ztown'.
Found 1 result
[Alright, first of all: I just joined the Forums, so if i do anything wrong, just tell me.] Ok, so i got a problem, it's about an event i want to trigger on a certain amount of zombie's, or on a certain timer, that's all fine and such.. But, i want to merge some event's into a resource called "zombies", like the 'onZombieWasted' event, but then for a seperated Event, What i mean with that is i want to have a new 'onNemesisWasted' event working together with the 'onZombieWasted', but they need to sync up with the (if possible exported) createZombie function from the "zombies" resource. And i am aiming to make it to a elementData trigger, that i locally created as for example: local Nemesis = export.zombies:createZombie(etc,etc..), So when i check for that element's data on the name 'Nemesis' by existence (as in: if ( isElement ( Nemesis ) ) then) and in combination on the 'onNemesisWasted'- event to check if that export of createZombie (ped works aswel) is dead or not, after all of that if the createZombie (ped) is actually dead, then i wan't it to trigger the reward system together with the other piece's of code. To clear out this idea and problem, i also recorded the ZTown Nemesis Event Script and also post the 2 main scripts that hold me from finishing the Nemesis: The Video of me, quickly explaining what, how, and showing the problem: "youtube" And the 2 script's, there both Server-Side, The Nemesis.lua is changed to test it's functionality and quick testing, but feel free to change the code and re-post it here to function with 'onNemesisWasted' additions!.. the first setTimer(function() is there to prevent complication problems from other zombie resource's and scripts, just delaying it for better run's. Also, the second setTimer(function() is just to delay it's Blip creation and Attaching to prevent the Blip not being attached to the createZombie named nemesis. Nemesis.lua (start/event): function nemesisON() setTimer(function() if ( not isElement ( Nemesis ) ) then local nemesis = exports.zombies:createZombie ( 2343, 57, 26.5, 90, 38, 0, 0, nemesis, 0, "hunting", true ) setPedHeadless(nemesis, true) exports.extrahealth:setElementExtraHealth ( nemesis, 150 ) setElementData ( nemesis, "nemesis", true ) setTimer(function() myBlip = createBlipAttachedTo ( nemesis, 23 ) outputChatBox ('#FFFFFF[#7CFC00ZTown#FFFFFF]: #00BFFF A #00FFFFNemesis #00BFFFHas been spawned inside ZTown! #FFFFFF(#7CFC00Nemesis Boss Event#FFFFFF)', root, 255, 255, 255, true) triggerClientEvent(root, "event", root, "start") end,2500,1) end end,2500,1) end addEventHandler ( "onResourceStart", getRootElement(), nemesisON) monemesi.lua (check/reward): addEvent ( "onNemesisWasted", true ) addEventHandler ( "onNemesisWasted", root, function ( killer ) if ( isElement ( Nemesis ) ) then givePlayerMoney(killer,math.random(5000,25000)) killer = getPlayerName(killer) destroyElement ( myBlip ) outputChatBox ('#FFFFFF[#7CFC00ZTown#FFFFFF]: #00BFFF The #00FFFFNemesis #00BFFFHas been killed! #FFFFFF(#7CFC00Nemesis-Boss Event#FFFFFF)', root, 255, 255, 255, true) triggerClientEvent(root, "event", root, "stop") end end ) I hope sombady could find a way to make this function correctly, because i have try'ed loads of ways, and the way to use slothbot together with zombies resource... nahh, won't work, they wil keep fighting together like d*cks. EDIT: if ( isElement ( Nemesis ) ) = nemesis, i already changed that, but right after i posted it, derp.. Gr.xboxxxxd