Jump to content

Is it possible too...


Xeno

Recommended Posts

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
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 by Guest
Link to comment
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" :P

But you are on the right track.

Link to comment
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...