Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local yes = script.Parent.Option1Yes
- local no = script.Parent.Option2No
- local bye = script.Parent.Option3Goodbye
- local player = game.Players.LocalPlayer.Character
- local inputted = script.Parent.Parent.Parent.ButtonGui.ButtonFrame.TalkToNPCScript.Inputted.Value
- yes.MouseButton1Click:Connect(function()
- if script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text == "Would you like extra walk speed?" then
- local text = "Ok. Here you go!"
- local length = string.len(text)
- for i = 1, length do
- script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text = text:sub(1, i)
- wait(0.04)
- end
- player.Humanoid.WalkSpeed = 100
- wait(0.5)
- script.Parent.Parent.Parent.ButtonGui.ButtonFrame.Visible = false
- script.Parent.Visible = false
- end
- end)
- no.MouseButton1Click:Connect(function()
- if script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text == "Would you like extra walk speed?" then
- local text = "Ok. Bye!"
- local length = string.len(text)
- for i = 1, length do
- script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text = text:sub(1, i)
- wait(0.04)
- end
- wait(0.5)
- script.Parent.Parent.Parent.ButtonGui.ButtonFrame.Visible = false
- script.Parent.Visible = false
- end
- end)
- bye.MouseButton1Click:Connect(function()
- if script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text == "Would you like extra walk speed?" then
- local text = "Goodbye!"
- local length = string.len(text)
- for i = 1, length do
- script.Parent.Parent.Parent.TalkGui.TalkFrame.Dialogue.Text = text:sub(1, i)
- wait(0.04)
- end
- wait(0.5)
- script.Parent.Parent.Parent.ButtonGui.ButtonFrame.Visible = false
- script.Parent.Visible = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement