So I am currently trying to make gui appear when the activate dialog, but there is a problem, Every tutorial I found, makes the gui appear when you click a dialog choise, not the actual dialog. Is there a way to do this? This is what I have so far:
script.Parent.DialogChoiceSelected:Connect(function(plr,dialog)
local event = game.ReplicatedStorage.DialogEvent
event:FireClient(plr)
end)
I am not trying to make a shop, I am trying to make a gui button appear with modal enabled so the mouse can move in first person so you can actually select dialog choices because the game is in first person only, If there is another way to do that, please let me know.
there are values you can manipulate within the player called CameraMaxZoomDistance and CameraMinZoomDistance, along with changing camera mode you should be able to move your mouse around freely
I know about those values, that is how I made the game first person, but how am I supposed to enable it? Every tutorial I found, had it so when the respond to the initial prompt, not when you click the big bubble that starts the conversation, the gui and other stuff appear. I can’t respond to the initial prompt, if I am in first person, but I can’t change that if I can’t do anything when I click the bubble.
When you fire a Remote to the client, you can do this :FireClient(player,true) or with false
and in a LocalScript inside the gui, when .OnClientEvent:Connect(function(value)
Do this: script.Parent.TextLabel.Modal = value
So i’ll look like this.
game.ReplicatedStorage.DialogEvent.OnClientEvent:Connect(function(value)
script.Parent.TextLabel.Modal = value
end)
I basically already have that, but I can’t start the event because I can’t find a way to for example, print “hi”. I want the hi to print only when the bubble that makes the character say it’s initial prompt to be clicked. If I replace hi with starting the events, I basically am done, but I can’t find a way to do that.
When that happens, when I press that button, I want the event to start.
Also here is the gui code:
local event = game.ReplicatedStorage.DialogEvent
local event2 = game.ReplicatedStorage.CloseDialogEvent
event.OnClientEvent:Connect(function()
script.Parent.Dialog.Visible = true
end)
event2.OnClientEvent:Connect(function()
script.Parent.Dialog.Visible = false
end)
I made something incredibly similar to this for the movement system, and it works perfectly.
what is seat? Also this is where the NobleNuna actually is lol:
But more importantly, I am planning on making many NPCs with different dialogs, Is there a way to do this without making a ton of scripts or cluttering a single script?
I tried the workspace:GetDescendants method, and this happened:
Code:
local dialog = workspace:GetDescendants()
for i, v in pairs(dialog) do
if i:IsA("Dialog") and i.Name == "TohungaDialog" then
i:GetPropertyChangedSignal("InUse"):Connect(function()
script.Parent.Dialog.Modal = i.InUse
end)
end
end
local dialog = workspace:GetDescendants()
for i, v in pairs(dialog) do
if v:IsA("Dialog") and v.Name == "TohungaDialog" then
v:GetPropertyChangedSignal("InUse"):Connect(function()
script.Parent.Dialog.Modal = v.InUse
end)
end
end
for _, Dialog in pairs(workspace:GetDescendants()) do
if Dialog:IsA("Dialog") and Dialog.Name == "TohungaDialog" then
Dialog:GetPropertyChangedSignal("InUse"):Connect(function()
script.Parent.Dialog.Modal = Dialog.InUse
end)
end
end
I don’t think Modal is a property of a Dialog, I think it is a property of gui buttons
local function DialogUsed(Dialog, Value)
script.Parent.Dialog.Modal =
end
for _, Dialog in pairs(workspace:GetDescendants()) do
if Dialog:IsA("Dialog") and Dialog.Name == "TohungaDialog" then
Dialog:GetPropertyChangedSignal("InUse"):Connect(DialogUsed)
end
end
I made a mistake above, I edited my script, that should work ig, I usually use separate functions but reading further into this post you didn’t need much, only modal being toggled I’ve seen by reading, I made my function shorter
using separate functions will sometimes make it more readable when using tons of multiple lines