|
| 29 Dec 2016 02:25 PM |
I need help with this script used to being up a gui when touching a part
function coffee() game.StarterGui.coffee.shop.Visible = true end script.Parent.Touched:connect(coffee)
Thanks
r+://588066076 Go Drink A Cup Of Water™ |
|
|
| Report Abuse |
|
|
|
| 29 Dec 2016 02:30 PM |
Anyone?
r+://588066076 Go Drink A Cup Of Water™ |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 29 Dec 2016 02:32 PM |
StaterGui is not part of the player, think of it more as a container for things that copy into players. So changing StarterGui does not influence the player until the player is reset(respawned).
However, you can use the parameter from the touched event and locate the character, then use GetPlayerFromCharacter( http://wiki.roblox.com/index.php?title=API:Class/Players/GetPlayerFromCharacter ). Then, get into PlayerGui. Everything is in there that you want. |
|
|
| Report Abuse |
|
|
|
| 29 Dec 2016 02:34 PM |
local function coffee(hit) local player=game.Players:GetPlayerFromCharacter(hit.Parent) if player then player.PlayerGui.coffee.shop.Visible=true end end script.Parent.Touched:connect(coffee)
|
|
|
| Report Abuse |
|
|
|
| 29 Dec 2016 02:34 PM |
Thanks i will read up on it
r+://588066076 Go Drink A Cup Of Water™ |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
| |
|
| |
|
|
| 29 Dec 2016 02:38 PM |
| ^ what an extremely useful reply! ^ |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
| |
|
|
| 29 Dec 2016 04:59 PM |
Sorry to reply late but the
local function coffee(hit) local player=game.Players:GetPlayerFromCharacter(hit.Parent) if player then player.PlayerGui.coffee.shop.Visible=true end end script.Parent.Touched:connect(coffee)
script is not working
r+://588066076 Go Drink A Cup Of Water™ |
|
|
| Report Abuse |
|
|