kevincouto6 Posted April 29, 2018 Share Posted April 29, 2018 Hello, I was thinking about creating a mission, Example killing 300 zombies could someone help me with this I have some doubts about how to eat Link to comment
Moderators IIYAMA Posted May 1, 2018 Moderators Share Posted May 1, 2018 Quote doubts about how to eat You want to eat zombies. ! This will tell you, when you have eaten your zombie: Client https://wiki.multitheftauto.com/wiki/OnClientPedWasted Server https://wiki.multitheftauto.com/wiki/OnPedWasted bon appétit / eet smakelijk / enjoy your dinner ! 1 Link to comment
kevincouto6 Posted May 1, 2018 Author Share Posted May 1, 2018 6 hours ago, IIYAMA said: You want to eat zombies. ! This will tell you, when you have eaten your zombie: Client https://wiki.multitheftauto.com/wiki/OnClientPedWasted Server https://wiki.multitheftauto.com/wiki/OnPedWasted bon appétit / eet smakelijk / enjoy your dinner ! Oops, maybe you should have got it wrong, wanted to add example missions kills 300 peds Link to comment
Moderators IIYAMA Posted May 1, 2018 Moderators Share Posted May 1, 2018 4 minutes ago, kevincouto6 said: Oops, maybe you should have got it wrong, wanted to add example missions kills 300 peds If you want to make an example, then isn't it correct of me to give you the right syntax for it? ??? Link to comment
kevincouto6 Posted May 2, 2018 Author Share Posted May 2, 2018 15 minutes ago, IIYAMA said: If you want to make an example, then isn't it correct of me to give you the right syntax for it? ??? Example I want to create a mission where you must kill 300 ped "zombies" for when you complete receive rewards and money Link to comment
Moderators IIYAMA Posted May 2, 2018 Moderators Share Posted May 2, 2018 1 minute ago, kevincouto6 said: Example I want to create a mission where you must kill 300 ped "zombies" for when you complete receive rewards and money Yes, I understand that already. So I helped you a bit with it. Now start with writing your example. Link to comment
kevincouto6 Posted May 2, 2018 Author Share Posted May 2, 2018 1 minute ago, IIYAMA said: Yes, I understand that already. So I helped you a bit with it. Now start with writing your example. Could you help me get started with no idea and my scripting skills are bad please, help me Link to comment
Moderators IIYAMA Posted May 2, 2018 Moderators Share Posted May 2, 2018 addEventHandler("onPedWasted", root, function (_, killer) -- a ped died end) Start with /\ I will help you more if you actually put energy in it yourself, which you are not doing at the moment. Good luck. Link to comment
kevincouto6 Posted May 2, 2018 Author Share Posted May 2, 2018 1 hour ago, IIYAMA said: addEventHandler("onPedWasted", root, function (_, killer) -- a ped died end) Start with /\ I will help you more if you actually put energy in it yourself, which you are not doing at the moment. Good luck. Hello, I can not do anything I'm not understanding things, I think there's another way you can help me, is there any video or tutorial explaining this? Link to comment
Dimos7 Posted May 2, 2018 Share Posted May 2, 2018 No we not give you code read because we are here to help you with a code you have and has errors or warnings Link to comment
Zorgman Posted May 2, 2018 Share Posted May 2, 2018 (edited) --UNTESTED! zombiesKilled = 0 function ZedMissionWin () zombiesKilled = 0 outputChatBox("Good job, mission completed!") removeEventHandler("onClientPedWasted",root,ZedMissionCheckKill) end function ZedMissionCheckKill (killer,weapon) local zed = getElementData(source,"zombie") if zed == true and killer == localPlayer then zombiesKilled = zombiesKilled+1 outputDebugString("A zed was killed, "..(300-zombiesKilled).." zeds left.") end if zombiesKilled >= 300 then ZedMissionWin() end end function startZedMission() addEventHandler("onClientPedWasted",root,ZedMissionCheckKill) end addCommandHandler("startzedmission", startZedMission) ^ It's bare bones, but this simple client-side script should get you started; read it from bottom up and try to understand how it works, then modify/add stuff one at a time, followed by testing and reverting if you break something. For instance, you can add a HUD kill counter, or a money reward for completing the mission. People will assist if you give it a try yourself, nobody will just do all the work for you. Good luck! Edited May 2, 2018 by Zorgman Link to comment
kevincouto6 Posted May 3, 2018 Author Share Posted May 3, 2018 I'm in doubt that something is going wrong when I try to just complete the mission in 4 zombies, and money and Xp are not working anyone could help me? --UNTESTED! zombiesKilled = 15 function ZedMissionWin () zombiesKilled = 15 outputChatBox("Good job, mission completed!") givePlayerMoney ( 100000 ) givePlayerXp ( 1500 ) removeEventHandler("onClientPedWasted",root,ZedMissionCheckKill) end function onlyPedforMisson () local getValidPedModels = { ( 22 ) ( 34 ) ( 48 ) ( 45 ) } end function = getMoneyAndXpAfhterComplet givePlayerMoney ( 100000 ) function ZedMissionCheckKill (killer,weapon) local zed = getElementData(source,"zombie") if zed == true and killer == localPlayer then zombiesKilled = zombiesKilled+1 outputDebugString("A zed was killed, "..(300-zombiesKilled).." zeds left.") end if zombiesKilled >= 300 then ZedMissionWin() end end function startZedMission() addEventHandler("onClientPedWasted",root,ZedMissionCheckKill,onlyPedforMisson) end addCommandHandler("startzedmission", startZedMission) Link to comment
Zorgman Posted May 4, 2018 Share Posted May 4, 2018 I don't want to disappoint you, but what you need first is this: Also this will be your best friend after you learn some basic lua: https://wiki.multitheftauto.com/wiki/Main_Page Link to comment
kevincouto6 Posted May 4, 2018 Author Share Posted May 4, 2018 5 hours ago, Zorgman said: I don't want to disappoint you, but what you need first is this: Also this will be your best friend after you learn some basic lua: https://wiki.multitheftauto.com/wiki/Main_Page Please help me with this? Link to comment
kevincouto6 Posted May 7, 2018 Author Share Posted May 7, 2018 @Zorgman Can anyone help me with this zombiesKilled = 5 function ZedMissionWin () zombiesKilled = 5 outputChatBox("Good job, mission completed!") givePlayerMoney ( 50000 ) removeEventHandler("onClientPedWasted",root,ZedMissionCheckKill) end function pedID getElementsByType ( "ped",15,25) end function ZedMissionCheckKill (killer,weapon) local zed = getElementData(source,"pedID") if zed == true and killer == localPlayer then zombiesKilled = zombiesKilled+1 outputDebugString("A zed was killed, "..(5-zombiesKilled).." zeds left.") end if zombiesKilled >= 5 then ZedMissionWin() end end function startZedMission() outputChatBox("mission") addEventHandler("onClientPedWasted",root,ZedMissionCheckKill) end addCommandHandler("mis", startZedMission) 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