MRThinker Posted July 8, 2018 Share Posted July 8, 2018 Hi all. Please give me a script for shouting in 15 distance like /s MrThinker Shouts : hi Thanks Link to comment
Tommy. Posted July 8, 2018 Share Posted July 8, 2018 chat_range=50 addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"L","down","chatbox","L") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"L","down","chatbox","L") 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,_,msg) local px,py,pz=getElementPosition(player) local nick=getPlayerName(player) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox(nick.." #ffffffShouts "..msg,v,30,30,200,true) end end end addCommandHandler("L",onChat) @Solidsnake14 Link to comment
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