Jump to content

kewizzle

Members
  • Posts

    164
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by kewizzle

  1. alright lets see works thanks so much
  2. it works but the pickup is destroyed still if l isnt pressed and so when it gets destroyed and i press l to pick it up it wont because its destroyed. oh i see you have to hold l down so it doesnt pick it up is there a way to make it so you can hold it down to pick it up? i want it to be set to where you have to hold it to pick it up.
  3. I did some more work and the event isnt cancelling at all. what am i doing wrong? Server outputServerLog ( "***Drop System Loaded ***" ) function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) --when a player dies if ( killer ) then if ( getElementType ( killer ) == "player" ) then x, y, z = getElementPosition ( source ) --get the position of the person who died and define it as x, y and z dropped = createPickup ( x, y, z, 2, math.random(22, 34), 0, math.random(1,3)) setTimer(destroyElement, 15000, 1, dropped) addEventHandler("onPlayerPickupHit",getRootElement(),checkPickupServer) else end end end addEventHandler ( "onPedWasted", getRootElement(), createDeathPickup ) function checkPickupServer(killer) if (getPickupType(dropped) == 2) then -- If it's an armour pickup triggerClientEvent ("checkPickup",killer,checkPickup) end end Client addEvent("checkPickup",true) addEventHandler("checkPickup",root, function () if getKeyState("l") == false then cancelEvent() else end end)
  4. oh :~ yeah youre right one second okay so now ive done this but player still picks the weapon up without asking first. server function checkPickupServer() triggerClientEvent ("checkPickup",source,checkPickup) end outputServerLog ( "***Drop System Loaded ***" ) function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) --when a player dies if ( killer ) then if ( getElementType ( killer ) == "player" ) then x, y, z = getElementPosition ( source ) --get the position of the person who died and define it as x, y and z dropped = createPickup ( x, y, z, 2, math.random(22, 34), 0, math.random(1,3)) addEventHandler("onPickupHit", dropped, destroyPickup) setTimer(destroyElement, 15000, 1, dropped) addEventHandler("onPickupHit", dropped, checkPickupServer) else end end end addEventHandler ( "onPedWasted", getRootElement(), createDeathPickup ) client addEvent("checkPickup",true) addEventHandler("checkPickup",root, function () if getKeyState("l") == false then cancelEvent() end end)
  5. i did this but i get this [09:19:17] ERROR: zombies\drops\server.lua:2: attempt to call global 'getKeyStat e' (a nil value)
  6. onPickupUse is a built in function so I thought it would work. Idk how I would define it.
  7. function checkPickup() if getKeyState( "l" ) == false then cancelEvent( onPickupUse ) else end end outputServerLog ( "***Drop System Loaded ***" ) function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) --when a player dies if ( killer ) then if ( getElementType ( killer ) == "player" ) then x, y, z = getElementPosition ( source ) --get the position of the person who died and define it as x, y and z dropped = createPickup ( x, y, z, 2, math.random(22, 34), 0, math.random(1,3)) addEventHandler("onPickupHit", dropped, destroyPickup) setTimer(destroyElement, 15000, 1, dropped) addEventHandler("onPickupHit", dropped, checkPickup) else end end end addEventHandler ( "onPedWasted", getRootElement(), createDeathPickup ) i got this far but it still picks the pickup up without me pressing the key. i guess im missing something?
  8. i went to ihop lol so ima get started now
  9. ill code it and post it here when i finish if it doesnt work and maybe we can see what is incorrect if it doesnt.
  10. event possibly would be onPickupHit?
  11. sure go for it maybe i can put it together. My zombies drop weapons at random from id 1-34 and they drop with a random ammo amount of 1-3 and when you collect a lot then youre supposed to sell it for $1 per bullet. all this works but my issue when i pickup a weapon in same slot some of them also reset the ammo count picked up.
  12. well i wanna bindKey to pickup, not necessarily give a weapon. I want it to ask if you wanna replace the weapon in the slot before you pick it up. Say you have a colt45 and theres a silenced pistol and you walk over it i want it to ask before you pick it up and then press a key to pick it up.
  13. i would like to know how to do this so i can choose to pickup a weapon so it wont replace current slot, or maybe use all weapons at same time without replacing weapon thats already in the slot.
  14. Nevermind i figured it out... addEventHandler ("onPlayerChat",getRootElement(), function(message,typ,player) if (type(string.find(message,"Text to look for")) == "number") then outputChatBox ( 'Text here that you want to be outputted when the above text is detected sent by player(does not have to be the only thing said in the message EX: "this is gonna appear after text to look for is found.")', getRootElement(), 255, 0, 0, true) end end)
  15. What functions and events would be used in a information bot im trynna find the one that sees like if a client typed weapon list a bot would output to chatbox saying the list of weapons
  16. This is my second resource release xP im proud of myself... It has a fully functional car spawn list and all the buttons do what they say xP and the outputs in chat box are random colors!!! Have fun with this. https://community.multitheftauto.com/index.php?p=resources&s=details&id=9678
  17. cause i mispelled the function in the post its been changed to 3 Rs lol my bad but thanks wow i just learned so much from that client shit u just laid down there lmfao
  18. okay so heres what i have done so far... Server function spawnCarrr() admin = getLocalPlayer() x, y, z = getElementPosition( admin ) createVehicle(411, x+3, y+3, z) end addEvent("spawnCarrr", true) addEventHandler("spawnCarrr", root, spawnCarrr) Client function spawnCarr() triggerServerEvent("spawnCarrr", root) end it all works i just need a way to make getLocalPlayer work on server side it there another Event that can be used or what? Cause if i put the vehicle spawn script client side it works right but non drivable..
  19. Okay so my server been up more than 24hours... my ports all open no firewall blocking i think it may be my ip address can someone help me... anyways ive been working hard on my server and its fun and safe. i would like to see people joining
  20. I FUCKING DID IT MYSELF :') exports.scoreboard:addScoreboardColumn('level') addEvent("onPlayerlevelUp",true) addEventHandler("onPlayerlevelUp",root, function (source) givePlayerMoney(source,math.random(1000)) addPlayerlevel(source) end) function addPlayerlevel(source) local account = getPlayerAccount(source) if isGuestAccount(account) then return end local level = tonumber ( getElementData ( player, "level" ) or 0 ) if not level then setAccountData(account,"level",0) end setAccountData(account,"level",tonumber(level)+1) end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local level = tonumber ( getElementData ( player, "level" ) or 0 ) if level then setElementData(source,"level",tostring(level)) else setElementData(source,"level",0) end end)
  21. exports.scoreboard:addScoreboardColumn('Level') addEvent("onPlayerLevelUp",true) addEventHandler("onPlayerLevelUp",root, function (source) givePlayerMoney(source,math.random(1000)) addPlayerLevel(source) end) function addPlayerLevel(source) local account = getPlayerAccount(source) if isGuestAccount(account) then return end local Level = getAccountData(account,"Level") if not Level then setAccountData(account,"Level",0) end setAccountData(account,"Level",tonumber(Level)+1) end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local Level = getAccountData(account,"Level") if zombieKills then setElementData(source,"Level",tostring(Level)) else setElementData(source,"Level",0) end end) All it does is show 0 in scoreboard i think i have the elements wrong but help me out here i know it only shows 0 in the scoreboard cause of the login function
  22. Yes when i give the weapon back with ammo wont shoot till i switch weapons and switch back but thats okay whos gonna stay on the same weapon while having zombies chase them lol theyll probably switch weapons on the way to get ammo anyway but thanks works perfect and i understand the script now i read through it and the side notes.
  23. OMG thanks so much now im going to read through it and see how it works
×
×
  • Create New...