I am trying to achieve a dialogue system. It’s very choppy so don’t worry about how badly i wrote the code just help with with the problem. In my dialogue script when i press a button it fires a remote event to the server passing a string containing which button was fired. On the recieving end of the function, I have a simple print statement so i can make sure it is recieving the function correctly. However when it prints, nothing is printed.
this is my script inside the gui
local RS = game:GetService("ReplicatedStorage")
local Reponse1 = script.Parent.Response.Response1
local Reponse2 = script.Parent.Response.Response2
local Reponse3 = script.Parent.Response.Response3
Reponse1.Activated:Connect(function()
RS.Remotes.Dialogue:FireServer("", "response1")
end)
Reponse2.Activated:Connect(function()
RS.Remotes.Dialogue:FireServer("", "response2")
end)
Reponse3.Activated:Connect(function()
RS.Remotes.Dialogue:FireServer("", "response3")
end)
this is my script inside the npc you click to interact with
local RS = game:GetService("ReplicatedStorage")
local d1 = "is this working"
local d2 = "good"
local d3 = "oh ok"
local b1 = "yes"
local b2 = "no"
local b3 = "bye"
local currentd = "start"
script.Parent.ClickDetector.MouseClick:Connect(function(player)
print("clicked")
player.PlayerGui.Dialogue.Enabled = true
player.PlayerGui.Dialogue.Response.Response1.Text = b1
player.PlayerGui.Dialogue.Response.Response2.Text = b2
player.PlayerGui.Dialogue.Response.Response3.Text = b3
RS.Remotes.Dialogue.OnServerEvent:Connect(function(player, response)
print(response)
end)
if currentd == "start" then
player.PlayerGui.Dialogue.DialogueContainer.Dialogue.Text = d1
end
end)
help