Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you use ScreenGUI as dialog?

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.

4 comments

0

For you to see the screen gui, it would have to be placed in StarterGui.

0

Also, you can't use MouseButton1Down on a model, that event only fires on a TextButto

0

If you have Skype or discord, you could let me know your name if you would want to learn or get help ;)

0

Thanks for the help! My Skype and Discord are GGMadness101. If you can, could you show me a script for this? Thanks.

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.