cocoaboys
|
  |
| Joined: 08 Sep 2013 |
| Total Posts: 488 |
|
|
| 06 Jul 2017 03:24 PM |
Hey, I'm not sure how to define a "StarterGUI"/"PlayerGUI" which is originally inserted into "StarterGUI" under game. This is how I did it, but it doesnt work:
local gui = game.Players.LocalPlayer.PlayerGui.ScreenGui |
|
|
| Report Abuse |
|
|
DylWithlt
|
  |
| Joined: 30 Apr 2008 |
| Total Posts: 300 |
|
|
| 06 Jul 2017 03:31 PM |
Okay so "StarterGui" is the directory of gui's that gets copied to every "PlayerGui" when they join or if set when they respawn. "PlayerGui" is the localplayers gui which is stored inside the player object. If you want to make something in the StarterGui do:
Instance.new("ScreenGui",game.StarterGui)
If you don't want to use a script to make it just put it in the StarterGui directory. Hope this helps! |
|
|
| Report Abuse |
|
|
cocoaboys
|
  |
| Joined: 08 Sep 2013 |
| Total Posts: 488 |
|
|
| 06 Jul 2017 03:33 PM |
| Thanks for replying! Yeah, the content of "StarterGUI" is transferred once the game starts, but my script works only when I press "Play"/"Play here" in Studio. It doesn't work when I Play the game from he browser. I think my definition of the variable is wrong here. |
|
|
| Report Abuse |
|
|
cocoaboys
|
  |
| Joined: 08 Sep 2013 |
| Total Posts: 488 |
|
|
| 06 Jul 2017 03:35 PM |
| The GUI is already made, and is placed in "StarterGUI" in Studio. |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2017 03:36 PM |
what are u even asking
you want to declare screengui as a variable? |
|
|
| Report Abuse |
|
|
cocoaboys
|
  |
| Joined: 08 Sep 2013 |
| Total Posts: 488 |
|
| |
|
cocoaboys
|
  |
| Joined: 08 Sep 2013 |
| Total Posts: 488 |
|
|
| 06 Jul 2017 03:38 PM |
| The name of the GUI is "ScreenGUI", and it contains "Frame" |
|
|
| Report Abuse |
|
|
DylWithlt
|
  |
| Joined: 30 Apr 2008 |
| Total Posts: 300 |
|
|
| 06 Jul 2017 03:39 PM |
| Not sure if you know this already but if you use LocalPlayer it has to be a LocalScript, studio can't tell the difference when you press play because it's running the server locally as well, try and use "Start" to run a local server. |
|
|
| Report Abuse |
|
|
cocoaboys
|
  |
| Joined: 08 Sep 2013 |
| Total Posts: 488 |
|
|
| 06 Jul 2017 03:42 PM |
| Aaaah I see! No I haven't learned that before. But what if I want to use a normal script? How do declare the GUI then? |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2017 03:47 PM |
| why would u need to declare a screengui from a server script if u cant do anything with it? |
|
|
| Report Abuse |
|
|
DylWithlt
|
  |
| Joined: 30 Apr 2008 |
| Total Posts: 300 |
|
| |
|
cocoaboys
|
  |
| Joined: 08 Sep 2013 |
| Total Posts: 488 |
|
|
| 06 Jul 2017 03:48 PM |
| ################ I have some code which manipulates the GUI :P But nothing works yet so I am worried the problem lies within the declaration |
|
|
| Report Abuse |
|
|
cocoaboys
|
  |
| Joined: 08 Sep 2013 |
| Total Posts: 488 |
|
|
| 06 Jul 2017 03:48 PM |
| Oooh hmm, I'll try transferring all the code to a LocalScript then, hope nothing breaks |
|
|
| Report Abuse |
|
|
DylWithlt
|
  |
| Joined: 30 Apr 2008 |
| Total Posts: 300 |
|
|
| 06 Jul 2017 03:49 PM |
| You can use RemoteEvents to cross the threshold if you want though. |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2017 03:50 PM |
| he would have to use a remotefunction to return the screengui |
|
|
| Report Abuse |
|
|
DylWithlt
|
  |
| Joined: 30 Apr 2008 |
| Total Posts: 300 |
|
|
| 06 Jul 2017 03:52 PM |
| Can you still return the players gui or any of it's children like that and then still be able to look through or edit it? I didn't know that. I thought you had to use a script and a localscript to do everything in the gui and a script outside to call that localscript and tell it to do things. |
|
|
| Report Abuse |
|
|
cocoaboys
|
  |
| Joined: 08 Sep 2013 |
| Total Posts: 488 |
|
|
| 06 Jul 2017 03:54 PM |
Hmmm, maybe I should try..? How would I do that? What is supposed to happen is that the screen (GUI) gets white after 5 secs, then eases out into transparent:
wait(5)
for i=0,100 do local gui = game.Players.LocalPlayer.PlayerGui.ScreenGui local frame = gui.Frame frame.BackgroundTransparency = 0 + i/100 wait(0.01) end
.... and then some more code related to something else .... |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2017 03:56 PM |
| that should work as long as its in a local script |
|
|
| Report Abuse |
|
|
cocoaboys
|
  |
| Joined: 08 Sep 2013 |
| Total Posts: 488 |
|
|
| 06 Jul 2017 03:57 PM |
Alright I'll try :) I like keeping the code as simple as possible |
|
|
| Report Abuse |
|
|
cocoaboys
|
  |
| Joined: 08 Sep 2013 |
| Total Posts: 488 |
|
|
| 06 Jul 2017 04:01 PM |
| Now nothing works... xD But I guess I could just have this part inside a LocalScript, and the rest in a Script? Then I could make them call each other? |
|
|
| Report Abuse |
|
|
cocoaboys
|
  |
| Joined: 08 Sep 2013 |
| Total Posts: 488 |
|
|
| 06 Jul 2017 04:02 PM |
| I could put the regular script in wait while the LocalScript performs |
|
|
| Report Abuse |
|
|
cocoaboys
|
  |
| Joined: 08 Sep 2013 |
| Total Posts: 488 |
|
|
| 06 Jul 2017 04:07 PM |
| Nothing happens when I put the code in a LocalScript |
|
|
| Report Abuse |
|
|