|
| 17 Dec 2016 04:56 PM |
p = script.Parent local deb = false function onTouch(hit) if deb == false then deb = true local title = Instance.new("ScreenGui", game.StarterGui) local text = Instance.new("Frame", title) end end
script.Parent.Touched:connect(onTouch)
When I click play, I see there's a screengui and frame, but it does not seem visible?? Does anyone know why this happens? |
|
|
| Report Abuse |
|
|
| |
|
Inigo18
|
  |
| Joined: 02 Feb 2014 |
| Total Posts: 1041 |
|
|
| 17 Dec 2016 05:10 PM |
You need to know the difference between StarterGui and PlayerGui. StarterGui is the GUI players start with, that means that if you probably reset after firing that code, your gui would display. Now in the other hand, PlayerGui is the GUI players CURRENTLY have. Basically, if you wanna make that display on your screen without dying, you'd need to parent it to PlayerGui.
|
|
|
| Report Abuse |
|
|
|
| 17 Dec 2016 05:14 PM |
| It spawns in the playergui, but it still is not visible |
|
|
| Report Abuse |
|
|
Inigo18
|
  |
| Joined: 02 Feb 2014 |
| Total Posts: 1041 |
|
| |
|
|
| 17 Dec 2016 05:16 PM |
p = script.Parent local deb = false function onTouch(hit) if deb == false then deb = true local title = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui) local text = Instance.new("Frame", title) end end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
Inigo18
|
  |
| Joined: 02 Feb 2014 |
| Total Posts: 1041 |
|
|
| 17 Dec 2016 05:26 PM |
is this a local or a server script? are there any errors?
|
|
|
| Report Abuse |
|
|
|
| 17 Dec 2016 05:29 PM |
| I've tried putting it in both normal and local and they both dont work. |
|
|
| Report Abuse |
|
|
Inigo18
|
  |
| Joined: 02 Feb 2014 |
| Total Posts: 1041 |
|
|
| 17 Dec 2016 05:30 PM |
where did you put the local one?
|
|
|
| Report Abuse |
|
|
|
| 17 Dec 2016 05:31 PM |
| in a part so when you touch the part it will pop up the gui |
|
|
| Report Abuse |
|
|
Inigo18
|
  |
| Joined: 02 Feb 2014 |
| Total Posts: 1041 |
|
|
| 17 Dec 2016 05:33 PM |
noooo sir, put it in StarterPack. You might want to do instead of script.Parent, do workspace.Part
|
|
|
| Report Abuse |
|
|
|
| 17 Dec 2016 05:36 PM |
| So I put the local script into it, but it still wont work |
|
|
| Report Abuse |
|
|
Inigo18
|
  |
| Joined: 02 Feb 2014 |
| Total Posts: 1041 |
|
|
| 17 Dec 2016 05:37 PM |
and you changed what I said?
|
|
|
| Report Abuse |
|
|
|
| 17 Dec 2016 05:39 PM |
p = script.Parent local deb = false function onTouch(hit) if deb == false then deb = true local title = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui) local text = Instance.new("Frame", title) end end
workspace.Indicator.Touched:connect(onTouch)
I renamed the part Indicator, but I dont think it would matter. p pretty much means nothing, and this is a local scipt in starterpack |
|
|
| Report Abuse |
|
|
Inigo18
|
  |
| Joined: 02 Feb 2014 |
| Total Posts: 1041 |
|
|
| 17 Dec 2016 05:41 PM |
ugh this is so weird. could you add a print inside the ontouch function to see if it fires?
|
|
|
| Report Abuse |
|
|
| |
|