George148

test1

Jun 9th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. local acceptablestuff = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0"}
  2. local whichtalk = 0
  3.  
  4. local settings = {
  5. canbeangry = true, --Can you talk slow if all letters are caps?
  6. talksound = "rbxassetid://417445954", --Sound that plays when you talk
  7. talkpitch = 1, --Talk Pitch
  8. talkvolume = 1, --Talk Volume
  9. }
  10.  
  11. function messagesend(msg,gui)
  12. local realmsg = "*"..msg
  13. local mouthvis = false
  14. whichtalk = whichtalk + 1
  15. local thistalk = whichtalk
  16. local isangry = true
  17. gui:WaitForChild("Frame").Visible = true
  18.  
  19. for i=1,string.len(msg) do
  20. local letter = string.sub(msg,i,i)
  21. if string.upper(letter) ~= letter then
  22. isangry = false
  23. end
  24. end
  25.  
  26. for i=2,string.len(realmsg) do
  27. local printedmsg = string.sub(realmsg,1,i)
  28. gui:WaitForChild("Frame").TextLabel.Text = printedmsg
  29. gui:WaitForChild("Frame").ImageLabel.Frame.Visible = false
  30. for i2=1,#acceptablestuff do
  31. if string.lower(string.sub(realmsg,i,i)) == acceptablestuff[i2] then
  32. mouthvis = not mouthvis
  33. gui:WaitForChild("Frame").ImageLabel.Frame.Visible = mouthvis
  34. gui.Sound:Play()
  35. end
  36. end
  37. if isangry then
  38. wait(.15)
  39. else
  40. wait(.05)
  41. end
  42. end
  43. gui:WaitForChild("Frame").ImageLabel.Frame.Visible = false
  44. local endtext = gui:WaitForChild("Frame").TextLabel.Text
  45. wait(5)
  46. if gui:WaitForChild("Frame").TextLabel.Text == endtext then
  47. gui:WaitForChild("Frame").Visible = false
  48. end
  49. end
  50.  
  51. function creategui(plr)
  52. local gui = plr:WaitForChild("PlayerGui"):FindFirstChild("TGDUTTalkGui") or Instance.new("ScreenGui",plr:WaitForChild("PlayerGui"))
  53. gui:ClearAllChildren()
  54. gui.Name = "TGDUTTalkGui"
  55. local initframe = Instance.new("Frame",gui)
  56. initframe.Size = UDim2.new(0,750,0,125)
  57. initframe.Position = UDim2.new(0.5,-375,1,-140)
  58. initframe.BackgroundColor3 = Color3.new(0,0,0)
  59. initframe.BorderColor3 = Color3.new(1,1,1)
  60. initframe.Visible = false
  61. initframe.BorderSizePixel = 5
  62. local chrimg = Instance.new("ImageLabel",initframe)
  63. chrimg.BackgroundTransparency = 1
  64. chrimg.Size = UDim2.new(0,300,0,125)
  65. chrimg.ZIndex = 2
  66. chrimg.Image = "http://www.roblox.com/thumbs/avatar.ashx?x=352&y=352&format=png&username=dGeo"
  67. chrimg.ImageRectOffset = Vector2.new(115,45)
  68. chrimg.ImageRectSize = Vector2.new(352,100)
  69. local chrmouth = Instance.new("Frame",chrimg)
  70. chrmouth.Size = UDim2.new(0,30,0,8)
  71. chrmouth.Position = UDim2.new(0.16,0,0.775,0)
  72. chrmouth.Rotation = 3
  73. chrmouth.BackgroundColor3 = Color3.new(0,0,0)
  74. chrmouth.BorderColor3 = Color3.new(0,102/255,0)
  75. chrmouth.ZIndex = 3
  76. local txt = Instance.new("TextLabel",initframe)
  77. txt.Size = UDim2.new(1,-210,1,-10)
  78. txt.Position = UDim2.new(0,200,0,5)
  79. txt.BackgroundTransparency = 1
  80. txt.ZIndex = 2
  81. txt.Font = Enum.Font.SourceSansBold
  82. txt.FontSize = Enum.FontSize.Size36
  83. txt.TextColor3 = Color3.new(1,1,1)
  84. txt.TextXAlignment = Enum.TextXAlignment.Left
  85. txt.TextYAlignment = Enum.TextYAlignment.Top
  86. txt.TextWrapped = true
  87. txt.Text = "*"
  88. local sound = Instance.new("Sound",gui)
  89. sound.SoundId = settings.talksound
  90. sound.Pitch = settings.talkpitch
  91. sound.Volume = settings.talkvolume
  92. game.Players.dGeo.Chatted:connect(function(msg)
  93. messagesend(msg,gui)
  94. end)
  95. end
  96.  
  97. function startupplr(c)
  98. if c.Character ~= nil then
  99. creategui(c)
  100. end
  101. c.CharacterAdded:connect(function()
  102. creategui(c)
  103. end)
  104. end
  105.  
  106. for _,c in pairs(game.Players:GetPlayers()) do
  107. startupplr(c)
  108. end
  109.  
  110. game.Players.PlayerAdded:connect(startupplr)
  111. --woot 110 lines (including spaces ;()
Advertisement
Add Comment
Please, Sign In to add comment