Jump to content

Script Problem[HELP]


Price.

Recommended Posts

where i typed GodMode Enabled, if i made it true and the other false the other chatbox when it says GodMode Disabled will keep getting repeated, ex: /staff "GodMode Disabled", /staff "GodModeDisabled" , /staff "GodMode Disabled" doesnt say except 1 chatbox if i reversed it.

Link to comment
team = createTeam ( "Staff", 255, 255, 255 ) 
  
function teamSet ( thePlayer ) 
    local team = getTeamFromName ( "Staff" ) 
    local account = getPlayerAccount ( thePlayer ) 
    if ( not account or isGuestAccount ( account ) ) then 
        return 
    end 
  
    local accountName = getAccountName(account ) 
    if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "L5" ) ) ) then 
        if ( not getElementData ( thePlayer, "invincible" ) ) then 
            setElementData ( thePlayer, "invincible", true ) 
            setElementModel ( thePlayer, 217 ) 
            setPlayerTeam ( thePlayer, team ) 
            setPlayerNametagColor ( thePlayer, 255, 255, 255 ) 
            outputChatBox ( "#00FF00GodMode Enabled", thePlayer, 0, 255, 0, true ) 
        else 
            outputChatBox ( "#FF0000GodMode Disabled", thePlayer, 255, 0, 0, true ) 
            setElementData ( thePlayer, "invincible", false ) 
        end 
    end 
end 
addEvent ( "sTeame", true ) 
addEventHandler ( "sTeame", root, teamSet ) 
addCommandHandler ( "staff", teamSet ) 

Link to comment

well let's forget about the chatbox, let's do when i do /staff it gets me to team and starts godmode normally

might this work? from 1st time.

team = createTeam ( "Staff", 255, 255, 255 ) 
  
function teamSet ( thePlayer ) 
    local team = getTeamFromName ( "Staff" ) 
    local account = getPlayerAccount ( thePlayer ) 
    if ( not account or isGuestAccount ( account ) ) then 
        return 
    end 
  
    local accountName = getAccountName(account ) 
    if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "L5" ) ) ) then 
        if getElementData ( thePlayer, "invincible" ) then 
            setElementData ( thePlayer, "invincible", false) 
            setElementModel ( thePlayer, 217 ) 
            setPlayerTeam ( thePlayer, team ) 
            setPlayerNametagColor ( thePlayer, 255, 255, 255 ) 
        else 
            setElementData ( thePlayer, "invincible", true) 
        end 
    end 
end 
addEvent ( "sTeame", true ) 
addEventHandler ( "sTeame", root, teamSet ) 
addCommandHandler ( "staff", teamSet ) 

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