Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- outputDebugString("localVoice -> Loading", 0, 0, 255, 0)
- --[[function leaveShape(colShape, dimension)
- if(colShape == voiceSphere) and (dimension)then
- if(source == "player")then
- left = source
- for i,p in ipairs(heardSouls)do
- if p == left then
- table.remove(heardSouls, i)
- end
- end
- end
- end
- end]]
- function localVoice()
- local x, y, z = getElementPosition(source)
- local voiceSphere = createColSphere(x, y, z, 20)
- local heardSouls = getElementsWithinColShape(voiceSphere, "player")
- setPlayerVoiceBroadcastTo(source, heardSouls)
- destroyElement(voiceSphere)
- setTimer(localVoice, 1000,1)
- end
- addEventHandler("onPlayerVoiceStart", getRootElement(), localVoice)
- ---addEventHandler("onElementColShapeLeave", getRootElement(), leaveShape)
- outputDebugString("localVoice -> Loading", 0, 0, 255, 0)
Advertisement
Add Comment
Please, Sign In to add comment