Local Script:
local ModuleScript = require(script.ModuleScript)
local Frame = script.Parent.Frame
local TextLabel = script.Parent.TextLabel
local Prox = game.Workspace.Part.ProximityPrompt
local Option1 = script.Parent.Option1
local Option2 = script.Parent.Option2
Option1.Transparency = 1
Option2.Transparency = 1
Frame.Transparency = 1
TextLabel.Transparency = 1
Option1.Interactable = false
Option2.Interactable = false
local function typeWrite(object,text,writeDelay)
for i = 1,#text,1 do
object.Text = string.sub(text,1,i)
wait(writeDelay)
end
end
Prox.Triggered:Connect(function(plr)
if plr then
Prox.Enabled = false
plr.Character.Humanoid.JumpPower = 0
plr.Character.Humanoid.WalkSpeed = 0
Frame.Transparency = 0
TextLabel.Transparency = 0
typeWrite(TextLabel,ModuleScript.FirstReply["Npc First Reply"],0.03)
task.wait(2)
Option1.Transparency = 0
Option2.Transparency = 0
Option1.Interactable = true
Option2.Interactable = true
typeWrite(Option1,ModuleScript.FirstReply["First Two Replies"].FirstBox,0.03)
typeWrite(Option2,ModuleScript.FirstReply["First Two Replies"].SecondBox,0.03)
end
task.wait(1.5)
Option1.MouseButton1Click:Connect(function()
if Option1.Transparency == 0 and Option1.Text == "Doing Good" then
Option1.Transparency = 1
Option2.Transparency = 1
Option1.Interactable = false
Option2.Interactable = false
typeWrite(TextLabel,ModuleScript.SecondReply["Npc Second Reply"],0.03)
task.wait(1)
Option1.Transparency = 0
Option2.Transparency = 0
Option1.Interactable = true
Option2.Interactable = true
--typeWrite(Option1,ModuleScript.SecondReply["Second Two Replies"].FirstBox)
if Option2.MouseButton1Click then
typeWrite(Option1,ModuleScript.SecondReply["Second Two Replies"].FirstBox,0.03)
typeWrite(Option2,ModuleScript.SecondReply["Second Two Replies"].SecondBox,0.03)
end
end
end)
Option2.MouseButton1Click:Connect(function()
if Option2.Transparency == 0 and Option2.Text == "Great" then
Option1.Transparency = 1
Option2.Transparency = 1
Option1.Interactable = true
Option2.Interactable = true
typeWrite(TextLabel,ModuleScript.SecondReply["Npc Second Reply"],0.03)
task.wait(1)
Option1.Transparency = 0
Option2.Transparency = 0
Option1.Interactable = true
Option2.Interactable = true
--typeWrite(Option2,ModuleScript.SecondReply["Second Two Replies"].SecondBox)
if Option1.MouseButton1Click then
typeWrite(Option1,ModuleScript.SecondReply["Second Two Replies"].FirstBox,0.03)
typeWrite(Option2,ModuleScript.SecondReply["Second Two Replies"].SecondBox,0.03)
end
end
end)
if Option1.Text == "Sure" then
Option1.MouseButton1Click:Connect(function()
Option1.Visible = false
Option2.Visible = false
Option1.Interactable = false
Option2.Interactable = false
Frame.Transparency = 1
TextLabel.Transparency = 1
end)
end
if Option2.Text == "Nah" then
Option2.MouseButton1Click:Connect(function()
Option1.Visible = false
Option2.Visible = false
Option1.Interactable = false
Option2.Interactable = false
Frame.Transparency = 1
TextLabel.Transparency = 1
end)
end
end)
Module Script:
local module = {}
module.FirstReply = {
["Npc First Reply"] = "Hey, how's it going.",
["First Two Replies"] = {
["FirstBox"] = "Doing Good",
["SecondBox"] = "Great"
},
}
module.SecondReply = {
["Npc Second Reply"] = "Want A Free Sword",
["Second Two Replies"] ={
["FirstBox"] = "Sure",
["SecondBox"] = "Nah"
}
}
return module
When I click on the first part of the dialogue it works and makes me move on to the second part of the dialogue its when I try to click on a option it just won’t do anything could someone help me fix this