KiffShark Posted November 12, 2012 Posted November 12, 2012 (edited) 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) else setElementAlpha(getLocalPlayer(), 255) outputChatBox ( "*Desactivado*", player, 255, 0, 0) end else end end end 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 November 20, 2012 by Guest https://www.youtube.com/PinkSharkGaming
Charlie_Jefferson Posted November 12, 2012 Posted November 12, 2012 Uhhm? Maybe because after "down" in the bindkey, it must be the function's name, which is invisible? Why am I saying maybe... Well anyway, that's why it isn't working.
HunT Posted November 12, 2012 Posted November 12, 2012 https://wiki.multitheftauto.com/wiki/BindKey bindKey ("n", "down", invisible) @Huntone_
KiffShark Posted November 12, 2012 Author Posted November 12, 2012 thanks!! Solved! I have got a question... if the script is type="client" people can see other people in invisibility mode? only i will be invisible in my screen? or for all players? https://www.youtube.com/PinkSharkGaming
./BlackBird# Posted November 12, 2012 Posted November 12, 2012 thanks!! Solved!I have got a question... if the script is type="client" people can see other people in invisibility mode? only i will be invisible in my screen? or for all players? i think you only will be invisible in your screen #~BlackBird~#
myonlake Posted November 12, 2012 Posted November 12, 2012 As MFNONFIK said, it will only be seen by the client. Use server-side to sync for all clients. For example use a server event trigger. If I helped you, please click the like button on the right Thanks!
KiffShark Posted November 12, 2012 Author Posted November 12, 2012 thaaanks! I had this question since a lot of time I'm so grateful thank you all! https://www.youtube.com/PinkSharkGaming
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