MPhil

Untitled

Sep 11th, 2011
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. outputDebugString("localVoice -> Loading", 0, 0, 255, 0)
  2.  
  3. --[[function leaveShape(colShape, dimension)
  4.     if(colShape == voiceSphere) and (dimension)then
  5.         if(source == "player")then
  6.             left = source
  7.             for i,p in ipairs(heardSouls)do
  8.                 if p == left then
  9.                     table.remove(heardSouls, i)
  10.                 end
  11.             end
  12.         end
  13.     end
  14. end]]
  15.  
  16. function localVoice()
  17.     local x, y, z = getElementPosition(source)
  18.     local voiceSphere = createColSphere(x, y, z, 20)
  19.     local heardSouls = getElementsWithinColShape(voiceSphere, "player")
  20.     setPlayerVoiceBroadcastTo(source, heardSouls)
  21.     destroyElement(voiceSphere)
  22.     setTimer(localVoice, 1000,1)
  23. end
  24.  
  25. addEventHandler("onPlayerVoiceStart", getRootElement(), localVoice)
  26. ---addEventHandler("onElementColShapeLeave", getRootElement(), leaveShape)
  27.  
  28. outputDebugString("localVoice -> Loading", 0, 0, 255, 0)
Advertisement
Add Comment
Please, Sign In to add comment