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.
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.