Advertisement
HowToRoblox

OptionsChosenScript

Nov 11th, 2019
2,792
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.73 KB | None | 0 0
  1. local yes = script.Parent.Option1Yes
  2. local no = script.Parent.Option2No
  3. local bye = script.Parent.Option3Goodbye
  4. local player = game.Players.LocalPlayer.Character
  5. local inputted = script.Parent.Parent.Parent.ButtonGui.ButtonFrame.TalkToNPCScript.Inputted.Value
  6.  
  7. yes.MouseButton1Click:Connect(function()
  8.    
  9.     if script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text == "Would you like extra walk speed?" then
  10.         local text = "Ok. Here you go!"
  11.         local length = string.len(text)
  12.        
  13.         for i = 1, length do
  14.                                
  15.             script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text = text:sub(1, i)
  16.             wait(0.04)
  17.         end
  18.         player.Humanoid.WalkSpeed = 100
  19.        
  20.         wait(0.5)
  21.         script.Parent.Parent.Parent.ButtonGui.ButtonFrame.Visible = false
  22.         script.Parent.Visible = false
  23.     end
  24. end)
  25.  
  26. no.MouseButton1Click:Connect(function()
  27.    
  28.     if script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text == "Would you like extra walk speed?" then
  29.         local text = "Ok. Bye!"
  30.         local length = string.len(text)
  31.        
  32.         for i = 1, length do
  33.                                
  34.             script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text = text:sub(1, i)
  35.             wait(0.04)
  36.         end
  37.        
  38.         wait(0.5)
  39.         script.Parent.Parent.Parent.ButtonGui.ButtonFrame.Visible = false
  40.         script.Parent.Visible = false
  41.     end
  42. end)
  43.  
  44. bye.MouseButton1Click:Connect(function()
  45.    
  46.     if script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text == "Would you like extra walk speed?" then
  47.         local text = "Goodbye!"
  48.         local length = string.len(text)
  49.        
  50.         for i = 1, length do
  51.                                
  52.             script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text = text:sub(1, i)
  53.             wait(0.04)
  54.         end
  55.        
  56.         wait(0.5)
  57.         script.Parent.Parent.Parent.ButtonGui.ButtonFrame.Visible = false
  58.         script.Parent.Visible = false
  59.     end
  60. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement