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

How to make a shop open when the player talks to an NPC? [closed]

Asked by 5 years ago

I want to make my shop GUI visible when the player asks my NPC to view the items on sale. I have no idea how to do this, as DialogChoiceSelected does not work with FE, and my game needs to be FE compatible. How will I achieve this?

0
This is not a request site, my own post got taken down for no reasonable action BloxRoxe 109 — 5y
0
He isnt asking for a script hes asking for a solution Faazo 84 — 5y
0
dialog guis dont work with fe unless there are remoteevents or some other stuff worklok -24 — 5y

Closed as Not Constructive by User#19524 and User#20388

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 5 years ago

Try making a Dialog inside an NPC's Head. There Should be "Choice1" and "Choice2" inside, otherwise you can just make more dialog replies.

Try putting this script inside the Dialog:


--MAKE SURE YOU DON'T COPY THE COMMENTS local Dialog = script.Parent Dialog.DialogChoiceSelected:connect(function(Player, Choice) if not Player then return end -- Choice1 is the name of the reply dialog in which the player will choose inorder to activate the gui, if Choice.Name == "Choice1" and Player.PlayerGui:findFirstChild("NAMEOFYORUGUI")--[[this makes sure that the player doesn't receive the same gui twice.]] == nil then local Gui = script.NAMEOFYOURGUI:clone() -- change NAMEOFYOURGUI to the name of your gui and make sure to put it under the script. Gui.Parent = Player.PlayerGui end end)
0
OK, I'm gonna try this. I have a question though, is this FE compatible? Ultimate_Miner64 45 — 5y
0
Hey, I tried this. It works pretty well in Studio, but then I realized in a Local Server that I had been making the same mistake. DialogChoiceSelected, unfortunately, does not work with FE. Ultimate_Miner64 45 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

Since DialogChoiceSelected does not work with FE, I used a ClickDetector instead. It worked.