Jump to content

who can fix this? (bindkey for toggle invisibility) [SOLVED]


Recommended Posts

Well... Hi everybody!

I need some help to do this script, I want a key (n) for set on/off invisivility (alpha 255->20; 20->255) only if you're in team "PSG"

This is what I have done, but it isn't works, I know how set it on/off with different commands or binds (but i want the same bindkey to "on" and "off")

function invisible() 
    for i, player in ipairs(getElementsByType("player")) do genTeam=getPlayerTeam(player) 
    if getTeamName(genTeam)=="PSG" then 
    if (getElementAlpha(player) == 255) then 
        setElementAlpha(getLocalPlayer(), 20) 
        outputChatBox ( "*Activado*", player, 255, 0, 0)  
        setElementAlpha(getLocalPlayer(), 255) 
        outputChatBox ( "*Desactivado*", player, 255, 0, 0)  
addCommandHandler ( "invi", invisible ) 
bindKey ("n", "down", "invi") 

I've tried it in 10000 ways before... -.-

some help please?

(I'm noob scripting so...)

thank! sorry for my english

Edited by Guest
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...