Xeno Posted November 27, 2011 Share Posted November 27, 2011 I have a script, that counts the number of zombies you have killed, it puts the kills on the scoreboard. exports.scoreboard:addScoreboardColumn('Zombie kills') addEvent("onZombieWasted",true) addEventHandler("onZombieWasted",root, function (killer) givePlayerMoney(killer,100) addPlayerZombieKills(killer) end) function addPlayerZombieKills(killer) local account = getPlayerAccount(killer) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie kills") if not zombieKills then setAccountData(account,"Zombie kills",0) end setAccountData(account,"Zombie kills",tonumber(zombieKills)+1) end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie kills") if zombieKills then setElementData(source,"Zombie kills",tostring(zombieKills)) else setElementData(source,"Zombie kills",0) end end) Would it be possible too have a certain GUI open if you have a certain amount of kills? So say I had under 24 kills, and if i typed /gui it would come up with a gui saying "YOUR SHIT AT KILLING ZOMBIES", but if I had 25 kills+ and typed /gui it would come up with a gui saying "YOUR AWESOME", is that possible? Its abit confusing, but I hope you guys understand, and if it is possible, could you show me how? Link to comment
12p Posted November 27, 2011 Share Posted November 27, 2011 It's not confusing It's simple. Here you have a list of things you need: client_anim.lua (search it on "race" gamemode) setTimer addCommandHandler Link to comment
Xeno Posted November 28, 2011 Author Share Posted November 28, 2011 It's not confusing It's simple.Here you have a list of things you need: client_anim.lua (search it on "race" gamemode) setTimer addCommandHandler I dont understand what im looking for in client_anim.lua? Link to comment
mjau Posted November 28, 2011 Share Posted November 28, 2011 look just make 2 differnet guis put them in a function each and do an if check like this if kills => 24 then GUI function else noobieGUIfunction Link to comment
Xeno Posted November 28, 2011 Author Share Posted November 28, 2011 (edited) look just make 2 differnet guis put them in a function each and do an if check like this if kills => 24 then GUI function else noobieGUIfunction Like this? if getElementData(lp,"Zombie kills") ~= <=100 then I made this but I added <= and it said unexpected Symbol.... function setTeamZombie() if getElementData(source,"Zombie kills") ~= 100 then sw = getTeamFromName("Subway Clan") setPlayerTeam(source, sw) end end addEventHandler("onPlayerLogin", root, setTeamZombie) Edited November 28, 2011 by Guest Link to comment
unknooooown Posted November 28, 2011 Share Posted November 28, 2011 look just make 2 differnet guis put them in a function each and do an if check like this if kills => 24 then GUI function else noobieGUIfunction Like this? if getElementData(lp,"Zombie kills") ~= <=100 then ' ~= <= ' You can't do that. Thats like saying: "If X is not the same as Y and X is less or the same as Y, then" But you are on the right track. Link to comment
Xeno Posted November 28, 2011 Author Share Posted November 28, 2011 look just make 2 differnet guis put them in a function each and do an if check like this if kills => 24 then GUI function else noobieGUIfunction Like this? if getElementData(lp,"Zombie kills") ~= <=100 then ' ~= <= ' You can't do that. Thats like saying: "If X is not the same as Y and X is less or the same as Y, then" But you are on the right track. I see. So how would I do it? Do you have any ideas? I made this so far... function setTeamZombie() if getElementData(source,"Zombie kills") ~= 100 then sw = getTeamFromName("Subway Clan") setPlayerTeam(source, sw) end end addEventHandler("onPlayerLogin", root, setTeamZombie) EDIT: NVM, fixed Thanks for the help guys! 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