Jump to content

Some Help in Points System :)


^Dev-PoinT^

Recommended Posts

i make this its say

 exports.scoreboard:scoreboardAddColumn("Points") 
exports.scoreboard:scoreboardAddColumn("Rank") 
  
ranks = {} 
ranks[1] = {5,"Level 1!"} 
ranks[2] = {10,"Level 2!"} 
ranks[3] = {20,"Level 3!"} 
ranks[4] = {30,"Level 4!"} 
ranks[5] = {40,"Level 5!"} 
ranks[6] = {50,"Level 6!"} 
ranks[7] = {60,"Level 7!"} 
ranks[8] = {70,"Level 8!"} 
ranks[9] = {80,"Level 9!"} 
ranks[10] = {40,"Level 10!"} 
  
  
function addPoints(ammo, attacker, weapon, bodypart) 
    local points = getElementData(attacker, "Points") 
    if attacker and attacker ~= source then 
        setElementData(attacker, "Points", tonumber(points) + 1) 
        outputChatBox(getPlayerName(attacker).." killed "..getPlayerName(source).." and gained 1 point.", getRootElement(), 255, 255, 0, false) 
    end 
end 
addEventHandler("onPlayerWasted", getRootElement(), addPoints) 
  
function onRankChanged(dataName) 
    if ( dataName == "Points" ) then 
        local playerPoints = getElementData( source, "Points" ) 
        for i,rank in ipairs(ranks) do 
            if ( playerPoints => rank[i][1] ) then 
                setElementData(source, "Rank", rank[i][2]) 
            end  
        end 
    end 
end 
addEventHandler("onElementDataChange",getRootElement(),onRankChanged) 
  
function onJoin ( ) 
    setElementData(source, "Points", 0) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), onJoin) 
  
function onResStart ( ) 
    for i,v in ipairs(getElementsByType ("player")) do  
        if not ( getElementData( v, "Points" ) ) then 
            setElementData( v, "Points", 0 ) 
        end 
    end 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(), onResStart ) 

server.lua:30: ')' expected near '='

Link to comment
  • 5 years later...

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...