|
| 25 Nov 2017 04:27 PM |
So basically I'm not sure how I'll continue from where I am right now. What I think I should do is to find a way to enter a users GUI and remove the GUI I had created from there. Problem is,I cant figure out how I'm supposed to do it. What I need to know is how to find all players GUI and remove it manually.
*The script works as intended for the actual game itself, just not for the players inside as tested when I ran it with the play button that doesn't spawn you in there.
The current script is as follows:
function dialogue(character, speaktext, waittime) timing = waittime a = Instance.new("ScreenGui", game.StarterGui) b = Instance.new("Frame", a) b.Size = UDim2.new(0.6,0,0.4,0) b.Position = UDim2.new(0.2,0,0.3,0) b.Transparency = 0.1 b.BackgroundColor3 = Color3.new(12, 12, 12) c = Instance.new("TextBox", b) wait(timing) b:remove() --(This removes the startergui from the general game but not from the ??? ??? end
Some pointers would be nice to have if possible. |
|
|
| Report Abuse |
|
|
| 25 Nov 2017 04:28 PM |
| You can use the :GetPlayers() function to get a table of players and use a for loop with it to remove the gui from each player in the table. |
|
|
| Report Abuse |
|
|
| 25 Nov 2017 04:31 PM |
| Btw when a player joins the game the gui they actually see isn't the one in startergui, everything from startergui gets cloned into their own individual playerguis. thats what they see. |
|
|
| Report Abuse |
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 25 Nov 2017 04:33 PM |
You can't remove GUIs from the PlayerGui on the server side unless they were added by the server in the first place. That would violate the rules of FE. You need to tell all the clients to remove the gui themselves, via a RemoteEvent:FireAllClients() and then having a local handler for that. |
|
|
| Report Abuse |
|