Advertisement
TheUnknownDiscord

bad morse code

Feb 1st, 2022 (edited)
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. part1 = Instance.new("Part", owner.Character)
  2. part1.Size = Vector3.new(10,10,1)
  3. part1.Anchored = true
  4. part1.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,2.5,0)
  5. local screengui2 = Instance.new("SurfaceGui", part1)
  6. screengui2.Name = "Hud"
  7. screengui2.Face = Enum.NormalId.Front
  8. local tl = Instance.new("TextBox", screengui2)
  9. tl.Size = UDim2.new(1, 0, 0.125, 0)
  10. tl.BackgroundTransparency = 0
  11. tl.AnchorPoint = Vector2.new(0.5, 0)
  12. tl.Position = UDim2.new(0.5, 0, 0, 0)
  13. tl.Text = "Lucas_YT111 morse code translator Version s"
  14. tl.TextSize = 30
  15. local tb = Instance.new("TextBox", screengui2)
  16. tb.Size = UDim2.new(1, 0, 1, 0)
  17. tb.BackgroundTransparency = 1
  18. tb.AnchorPoint = Vector2.new(0.5, 0.5)
  19. tb.Position = UDim2.new(0.5, 0, 0.5, 0)
  20. local tb2 = Instance.new("TextBox", screengui2)
  21. tb2.Size = UDim2.new(0.25, 0, 0.25, 0)
  22. tb2.BackgroundTransparency = 1
  23. tb2.TextTransparency = 0.35
  24. tb2.AnchorPoint = Vector2.new(0.5, 0.75)
  25. tb2.Position = UDim2.new(0.5, 0, 0.75, 0)
  26. tb2.TextSize = 30
  27. local dot = Instance.new("Sound", part1)
  28. dot.Volume = 2
  29. dot.SoundId = "rbxassetid://967014213"
  30. dot.Looped = true
  31. tb.Text = ""
  32. tb.TextSize = 40
  33. owner.Chatted:Connect(function(Text)
  34. tb.Text = ""
  35. tb2.Text = Text
  36. for Letter in string.gmatch(Text, ".") do
  37. tb.Text = tb.Text.." "
  38. if string.lower(Letter) == "h" then
  39. tb.Text = tb.Text.."...."
  40. elseif string.lower(Letter) == "e" then
  41. tb.Text = tb.Text.."."
  42. elseif string.lower(Letter) == "l" then
  43. tb.Text = tb.Text..".-.."
  44. elseif string.lower(Letter) == "o" then
  45. tb.Text = tb.Text.."---"
  46. elseif string.lower(Letter) == "p" then
  47. tb.Text = tb.Text..".--."
  48. elseif string.lower(Letter) == "i" then
  49. tb.Text = tb.Text..".."
  50. elseif string.lower(Letter) == "m" then
  51. tb.Text = tb.Text.."--"
  52. elseif string.lower(Letter) == "a" then
  53. tb.Text = tb.Text..".-"
  54. elseif string.lower(Letter) == "v" then
  55. tb.Text = tb.Text.."...-"
  56. elseif string.lower(Letter) == "t" then
  57. tb.Text = tb.Text.."-"
  58. elseif string.lower(Letter) == "b" then
  59. tb.Text = tb.Text.."-..."
  60. elseif string.lower(Letter) == "c" then
  61. tb.Text = tb.Text.."-.-."
  62. elseif string.lower(Letter) == "d" then
  63. tb.Text = tb.Text.."-.."
  64. elseif string.lower(Letter) == "f" then
  65. tb.Text = tb.Text.."..-."
  66. elseif string.lower(Letter) == "g" then
  67. tb.Text = tb.Text.."--."
  68. elseif string.lower(Letter) == "j" then
  69. tb.Text = tb.Text..".---"
  70. elseif string.lower(Letter) == "k" then
  71. tb.Text = tb.Text.."-.-"
  72. elseif string.lower(Letter) == "n" then
  73. tb.Text = tb.Text.."-."
  74. elseif string.lower(Letter) == "q" then
  75. tb.Text = tb.Text.."--.-"
  76. elseif string.lower(Letter) == "r" then
  77. tb.Text = tb.Text..".-."
  78. elseif string.lower(Letter) == "s" then
  79. tb.Text = tb.Text.."..."
  80. elseif string.lower(Letter) == "u" then
  81. tb.Text = tb.Text.."..-"
  82. elseif string.lower(Letter) == "w" then
  83. tb.Text = tb.Text..".--"
  84. elseif string.lower(Letter) == "x" then
  85. tb.Text = tb.Text.."-..-"
  86. elseif string.lower(Letter) == "y" then
  87. tb.Text = tb.Text.."-.--"
  88. elseif string.lower(Letter) == "z" then
  89. tb.Text = tb.Text.."--.."
  90. elseif string.lower(Letter) == " " then
  91. tb.Text = tb.Text.." / "
  92. end
  93. end
  94. wait()
  95. for Letter in string.gmatch(tb.Text, ".") do
  96. if Letter == "." then
  97. dot:Play()
  98. wait(0.5)
  99. dot:Stop()
  100. wait(0.25)
  101. elseif Letter == "-" then
  102. dot:Play()
  103. wait(1)
  104. dot:Stop()
  105. wait(0.25)
  106. elseif Letter == " " then
  107. wait(0.5)
  108. end
  109. end
  110. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement