ZuKi|R Posted November 26, 2017 Share Posted November 26, 2017 (edited) Hello, I am trying to create a Nemesis that is created with an area and that that area is adapted to the Nemesis but do not manage to do it a suggestion or help? server.lua function Boss ( ) NemesisRa = exports [ "slothBot" ]:spawnBot ( -2551.4892578125, 640.34375, 27.8125, 90, 312, 0, 0, NemesisRa, 23,"chasing", true ) setElementModel ( NemesisRa, 134 ) exports.extra_health:setElementExtraHealth ( NemesisRa, 5000 ) exports.BiOWindow: show ( getRootElement (), "info", "#FF0000[EVENTO]> #00ff00El Boss De San Fierro Ha Aparecido\n#00ff00Si lo Matas De Recompenza Se Te Dara #00ff00$15.000", 8000,"#FF0000|ZA|~> Zombie Attack ~ Boss SF",false ) local hillArea = createColRectangle (NemesisRa, 90, 150 ) attachElements ( hillArea, NemesisRa, 0, 0, 2 ) local x, y, z = getElementPosition(NemesisRa) blipRa = (createBlipAttachedTo ( NemesisRa, 23 )) setElementData ( NemesisRa, "nemesis1", true ) setTimer(Boss, 3000000, 1) setTimer(destroyElement, 3000000, 1, NemesisRa) setTimer(destroyElement, 3000000, 1, blipRa) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), Boss ) function hill_Enter ( thePlayer, matchingDimension ) -- announce to everyone that the player entered the hill if (getElementType(thePlayer) == "player") then outputChatBox( getPlayerName(thePlayer) .. " entered the zone!", getRootElement(), 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) triggerClientEvent (thePlayer, "nsound", thePlayer ) end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) Edited November 26, 2017 by ZuKi|R Link to comment
Moderators IIYAMA Posted November 26, 2017 Moderators Share Posted November 26, 2017 You are not specific enough. Link to comment
ZuKi|R Posted November 26, 2017 Author Share Posted November 26, 2017 3 hours ago, IIYAMA said: You are not specific enough. I am trying to create a zone that ties with the Nemesis and each player who approaches the Nemesis that serious that between wing zone of Nemesis lowers the life to him whenever it approaches to him Link to comment
Moderators IIYAMA Posted November 26, 2017 Moderators Share Posted November 26, 2017 Just now, ZuKi|R said: I am trying to create a zone that ties with the Nemesis and each player who approaches the Nemesis that serious that between wing zone of Nemesis lowers the life to him whenever it approaches to him Your goal is clear, but you do not describe your problem. Link to comment
ZuKi|R Posted November 26, 2017 Author Share Posted November 26, 2017 2 minutes ago, IIYAMA said: Your goal is clear, but you do not describe your problem. The code I did it of that way… but it does not create the zone in the Nemesis does not tie it… not as it is my error in the code. Link to comment
Moderators IIYAMA Posted November 26, 2017 Moderators Share Posted November 26, 2017 There should be a warning on line 26. Because the hillArea hasn't been created yet. That happens after the resource has been started. Link to comment
ZuKi|R Posted November 26, 2017 Author Share Posted November 26, 2017 If it leaves a warning to me in line and other lines on the 26 zone and the entailment that I must do? link of debugscript ---> https://ibb.co/featsm Link to comment
Moderators IIYAMA Posted November 26, 2017 Moderators Share Posted November 26, 2017 It is always recommended to check if something has been created (or not) before executing more code. if NemesisRa then -- ... else iprint("NemesisRa has not been created") end This is not good, using the same variable for different data, which will overwrite itself. Unless there is a very good reason for... NemesisRa = exports [ "slothBot" ]:spawnBot ( -2551.4892578125, 640.34375, 27.8125, 90, 312, 0, 0, NemesisRa, 23,"chasing", true ) 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