KCROL_AdminLeaks

LoadLibrary Dropdown Message/Hint Menu

May 19th, 2018
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.04 KB | None | 0 0
  1. local owner = "KCROL" --// Who the GUI will load on
  2. local RbxGui = LoadLibrary("RbxGui")
  3. local GUI = Instance.new("ScreenGui")
  4. GUI.Parent = game:GetService("Players")[owner].PlayerGui
  5.  
  6. local onChat = true
  7. local typec = ""
  8.  
  9. local items = {"Choose One", "Message Something", "Hint Something"}
  10.  
  11. game:GetService("Players")[owner].Chatted:connect(function(msg)
  12.     if onChat == true then
  13.         if typec == "Message" then
  14.             onChat = false
  15.             typec = ""
  16.             local m = Instance.new("Message")
  17.             m.Parent = workspace
  18.             for i = 1, string.len(msg),1 do
  19.                 m.Text = string.sub(msg,1,i)
  20.                 wait(0.05)
  21.             end
  22.             wait(3)
  23.             for i = string.len(msg),0,-1 do
  24.                 m.Text = string.sub(msg,1,i)
  25.                 wait()
  26.             end
  27.             m:Destroy()
  28.         elseif typec == "Hint" then
  29.             onChat = false
  30.             typec = ""
  31.             local m = Instance.new("Hint")
  32.             m.Parent = workspace
  33.             for i = 1, string.len(msg),1 do
  34.                 m.Text = string.sub(msg,1,i)
  35.                 wait(0.05)
  36.             end
  37.             wait(3)
  38.             for i = string.len(msg),0,-1 do
  39.                 m.Text = string.sub(msg,1,i)
  40.                 wait()
  41.             end
  42.             m:Destroy()
  43.         end
  44.     end
  45. end)
  46.  
  47. local function onItemSelected(itemSelected)
  48.     if itemSelected == "Message Something" then
  49.         if typec == "Hint" then
  50.             error("Hint is already activated. Use that first.")
  51.         elseif typec == "Message" then
  52.             error("You already have a message session activated! Use that first.")
  53.         else
  54.             print("Chat what you want to message.")
  55.             typec = "Message"
  56.             onChat = true
  57.         end
  58.     elseif itemSelected == "Hint Something" then
  59.         if typec == "Message" then
  60.             error("Message is already activated. Use that first.")
  61.         elseif typec == "Hint" then
  62.             error("You already have a hint session activated! Use that first.")
  63.         else
  64.             print("Chat what you want to hint.")
  65.             typec = "Hint"
  66.             onChat = true
  67.         end
  68.     end
  69. end
  70.  
  71. local dropDown = RbxGui.CreateDropDownMenu(items,onItemSelected,false,true) --// This returns a frame which will be parented into the ScreenGUI we created on Line 3
  72. dropDown.Parent = GUI
  73. dropDown.Size = UDim2.new(0,210,0,30)
  74. dropDown.Position = UDim2.new(0.85,-75,0.1,-15)
Advertisement
Add Comment
Please, Sign In to add comment