Sirshark10

E2 Text API

Nov 25th, 2016
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. @name Clouds Text API
  2. @inputs
  3. @outputs
  4. @persist
  5. @trigger
  6.  
  7. function number holoText(Index,Input:string,Bodygroup){
  8. local MODELBASE = "models/sprops/misc/alphanum/alphanum_"
  9. local Symb = table("."="prd.mdl",","="com.mdl","!"="xmark.mdl","?"="qmark.mdl","@"="atsign.mdl","~"="tilde.mdl","#"="pdsign.mdl",
  10. "$"="dlsign.mdl","%"="pcnt.mdl","^"="crt.mdl","&"="and.mdl","*"="ast.mdl","("="lpar.mdl",")"="rpar.mdl","'"="apost.mdl",
  11. "["="lbracket.mdl","]"="rbracket.mdl","{"="lcbracket.mdl","}"="rcbracket.mdl","|"="bar.mdl","+"="plu.mdl","-"="min.mdl",
  12. "_"="underscore.mdl","<"="lessthan.mdl",">"="greaterthan.mdl","="="equal.mdl",":"="colon.mdl",";"="scolon.mdl","\""="quote.mdl",
  13. "/"="div.mdl")
  14.  
  15. Text = Input:explode("")
  16.  
  17. holoCreate(Index)
  18. FLOW = holoEntity(Index)
  19. holoScale(Index,vec(0,0,0))
  20.  
  21. holoCreate(Text:count()+2)
  22. CENTER = holoEntity(Text:count()+2)
  23. holoScale(Text:count()+2,vec(0,0,0))
  24. holoPos(Text:count()+2,FLOW:pos()+vec(10,0,0)*(Text:count()/2))
  25. CentIndex = Text:count()+2
  26. for(I=1,Text:count()){
  27. if(Symb:exists(Text[I,string])){
  28. holoCreate(Index+I)
  29. holoPos(Index+I, FLOW:pos()+vec(10,0,0)*I)
  30. holoModel(Index+I,MODELBASE+Symb[Text[I,string],string])
  31. }
  32. elseif(Text[I,string]:upper() == Text[I,string] & Text[I,string]:findRE("%w")){
  33. holoCreate(Index+I)
  34. holoPos(Index+I, FLOW:pos()+vec(10,0,0)*I)
  35. holoModel(Index+I,MODELBASE+Text[I,string]+".mdl")
  36. }
  37. elseif(Text[I,string]:upper() != Text[I,string] & Text[I,string]:findRE("%w")){
  38. holoCreate(Index+I)
  39. holoPos(Index+I, FLOW:pos()+vec(10,0,0)*I)
  40. holoModel(Index+I,MODELBASE+"l_"+Text[I,string]+".mdl")
  41. }
  42. holoParent(Index+I, CENTER)
  43. holoMaterial(Index+I, "models/debug/debugwhite")
  44. holoAng(Index+I,ang(vec(0,180,0)))
  45. }
  46.  
  47. return CentIndex
  48. }
Advertisement
Add Comment
Please, Sign In to add comment