|
| 09 Jan 2017 12:01 PM |
| I'm making a hotline place where people can go to quickly ask a question and get answers, by bots or administrators. How would I make it so when a player says something specific, like "mystery", a GUI that I made will pop up for that player? I want to set this up so if a player says something specific like a game's name, a GUI will pop up telling them where they can go to get help on that topic. I'd like the script for this please, if possible. |
|
|
| Report Abuse |
|
|
DylWithlt
|
  |
| Joined: 30 Apr 2008 |
| Total Posts: 300 |
|
|
| 09 Jan 2017 12:03 PM |
Try playing with string manipulation you'd use string.lower, and string.match to find keywords the player said and check if it's not nil
|
|
|
| Report Abuse |
|
|
|
| 09 Jan 2017 12:05 PM |
| I don't really know how to do that. I know how to script in basic aspects, but I don't know how I would do that. That's why I asked for the script :P |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2017 12:12 PM |
The script you want would probably look something like this.
GUI = script.Parent:WaitForChild("GUI") -- Assuming the GUI is defined.
game.Players.PlayedAdded:Connect(function(player) player.Chatted:Connect(function(string,plr) if string == "mystery" then if not plr.PlayerGui:FindFirstChild("GUI") then local GUIClone = GUI:Clone();GUIClone.Parent = plr.PlayerGui end end end) end)
|
|
|
| Report Abuse |
|
|
DylWithlt
|
  |
| Joined: 30 Apr 2008 |
| Total Posts: 300 |
|
|
| 09 Jan 2017 12:12 PM |
We'd need to know exactly what you wanted for a script but heres something similar:
game.Players.PlayerAdded:connect(function(plr) plr.Chatted:connect(function(msg,to) if string.match(string.lower(msg),"Keyword") then showgui() end end) end)
|
|
|
| Report Abuse |
|
|
|
| 09 Jan 2017 12:13 PM |
[CORRECTION]
Here's the fixed one
GUI = script.Parent:WaitForChild("GUI") -- Assuming the GUI is defined.
game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(string,plr) if string == "mystery" then if not plr.PlayerGui:FindFirstChild("GUI") then local GUIClone = GUI:Clone();GUIClone.Parent = plr.PlayerGui end end end) end)
|
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 09 Jan 2017 12:13 PM |
Do this locally instead. No reason to do it on the server. Plus, if you're in FE, the server cannot access the player's PlayerGui for items unless it puts them there.
|
|
|
| Report Abuse |
|
|
DylWithlt
|
  |
| Joined: 30 Apr 2008 |
| Total Posts: 300 |
|
|
| 09 Jan 2017 12:14 PM |
In soybeans case just do
game.Players.LocalPlayer.Chatted:connect(msg,to) blah blah blah end)
instead
|
|
|
| Report Abuse |
|
|
|
| 10 Jan 2017 06:50 AM |
| What I would need exactly is a GUI named MysteryGUI to pop up when someone says "Mystery." Would I need to do anything like create a string value, or make any new files? If so, please let me know |
|
|
| Report Abuse |
|
|