So, I’m working on a npc system, but the text won’t change.
local ProxPrompt = script.Parent
local Gui = script.Parent.Parent.Parent.Dialogue
local NpcPicture = Gui.MainFrame.DialogueFrame.NpcPicture
local NpcTitle = Gui.MainFrame.DialogueFrame.NpcTitle
local DialogueText = Gui.MainFrame.DialogueFrame.Dialogue
local NextButton = Gui.MainFrame.DialogueFrame.NextButton
ProxPrompt.Enabled = true
ProxPrompt.Triggered:Connect(function(Player)
local GuiClone = Gui:Clone()
local Dialogue = GuiClone.MainFrame.DialogueFrame.Dialogue
GuiClone.Enabled = true
Player = game.Players:FindFirstChild(Player.Name)
GuiClone.Parent = Player.PlayerGui
GuiClone.MainFrame.DialogueFrame.NpcPicture.Image = "rbxassetid://9011713759"
GuiClone.MainFrame.DialogueFrame.NpcTitle.Text = "Noob"
GuiClone.MainFrame.DialogueFrame.Dialogue.Text = "Oh, hi...welcome to noobland!"
if GuiClone then
ProxPrompt.Enabled = false
NextButton.MouseButton1Click:Connect(function()
GuiClone.MainFrame.DialogueFrame.Dialogue.Text = "I'm Bob"
end)
end
end)
This is a server script in a proximityPrompt in the npc’s torso
my problem is that after the player hits the next button it does not change the text to “I’m Bob”.
This is my Gui in the npc to understand the script better.
And then use the following code in the local script:
local ProxPrompt = "your proximity prompt from the workspace down"
local Gui = script.Parent
Gui.Enabled = false
local NpcPicture = Gui.MainFrame.DialogueFrame.NpcPicture
local NpcTitle = Gui.MainFrame.DialogueFrame.NpcTitle
local DialogueText = Gui.MainFrame.DialogueFrame.Dialogue
local NextButton = Gui.MainFrame.DialogueFrame.NextButton
ProxPrompt.Enabled = true
ProxPrompt.Triggered:Connect(function(Player)
if not Player == game.Players.LocalPlayer then return end
local Dialogue = GuiClone.MainFrame.DialogueFrame.Dialogue
Gui.Enabled = true
Gui.MainFrame.DialogueFrame.NpcPicture.Image = "rbxassetid://9011713759"
Gui.MainFrame.DialogueFrame.NpcTitle.Text = "Noob"
Gui.MainFrame.DialogueFrame.Dialogue.Text = "Oh, hi...welcome to noobland!"
ProxPrompt.Enabled = false
NextButton.MouseButton1Click:Connect(function()
GuiClone.MainFrame.DialogueFrame.Dialogue.Text = "I'm Bob"
end)
end)
Yes, if we code it right. I could formulate another script if you tell me the other things you want him to say! And also, you want it to say these after they hit the next button again right?