Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do you use ScreenGUI as dialog?

Asked by 7 years ago

I want to make it so when someone clicks on the NPC, the dialog would pop-up. However, I tried to do so but just can't do it. Here are script that I tried:

AS = script.Parent -- NPC
GUI = script.Parent.FirstTextGui --- ScreenGUI
Frame = script.Parent.FirstTextGui.FirstTextBox -- Frame
Text = script.Parent.FirstTextGui.FirstTextBox.FirstText -- TextBox
Next = script.Parent.FirstTextGui.FirstTextBox.FirstText.NextButton -- TextButton
Talk = false

AS.MouseButton1Down:connect(function(talk)
    if Talk == false then
        GUI.Enabled = true
        Frame.Visible = true
        Text.Visible = true
        Next.Visible = true
    end
end)

This is my first time coding in Lua so I need all of the help that I can get. If you could, please try to shorten down the script.

0
For you to see the screen gui, it would have to be placed in StarterGui. FiredDusk 1466 — 7y
0
Also, you can't use MouseButton1Down on a model, that event only fires on a TextButto FiredDusk 1466 — 7y
0
If you have Skype or discord, you could let me know your name if you would want to learn or get help ;) FiredDusk 1466 — 7y
0
Thanks for the help! My Skype and Discord are GGMadness101. If you can, could you show me a script for this? Thanks. marioblast1244 113 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

You would need to detect when a click detector is clicked. A clickdetector passes the play argument so you can find the GUI and make it visible from there.

http://wiki.roblox.com/index.php?title=API:Class/ClickDetector

Also, do make sure that for you to effectively and potentially interact with the screen GUI, it would have to be placed/copied into StarterGui. ClickDetectors CAN work in models in the right conditions, for your information.

Ad

Answer this question