Jump to content

Raffica

Members
  • Posts

    5
  • Joined

  • Last visited

Details

  • Gang
    downloads

Raffica's Achievements

Vic

Vic (3/54)

0

Reputation

  1. Did I say that I CREATED this? No.. I told you I am just trying to learn lua. I am not a scripter.. Please if you are going to accuse me for "stealing" scripts to learn, then don't post here because I made this topic to get an answer that will help me to the next step in my learning. And if you noticed this now you must be blind because I clearly wrote that I "googled" to find this. And btw I am not making a server so why would I want to steal stuff? Now please go on topic and help me or just leave me alone.. EDIT: Sorry for using the word "make" >.>
  2. Sorry didn't solve the problem
  3. But now it's the same color all the time.. I want the player name to be same color as their team and if no team players name should be white.
  4. Thanks, But I still get this in the chat when the player that is typing got no team..
  5. Hey there! I just started with lua scripting so I'm a newbie. After an hour of "googling" I managed to make this what people call localchat. But I got one (if not more ;P) problem, when I type in localchat the text is in the same color as the players name and I don't want this. I want the text to be white but keep the players color. I added #ffffff at line 26 but when the player is not in team the chat get like this: Raffica: #ffffff Hello. Which is anoying. Please help me with this! Script: chat_range=75 addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"u","down","chatbox","NearbyChat") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"u","down","chatbox","NearbyChat") end end) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function onChat(player,_,...) local px,py,pz=getElementPosition(player) local msg = table.concat({...}, " ") local nick=getPlayerName(player) local r,g,b = getTeamColor(getPlayerTeam(player)) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("(Nearby)"..nick..": #ffffff"..msg,v,r,g,b,true) end end end addCommandHandler("NearbyChat",onChat)
×
×
  • Create New...