generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: step on part to open gui

Previous Thread :: Next Thread 
UnbeatableChicken is not online. UnbeatableChicken
Joined: 30 Mar 2014
Total Posts: 10252
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
UnbeatableChicken is not online. UnbeatableChicken
Joined: 30 Mar 2014
Total Posts: 10252
29 Dec 2016 02:30 PM
Anyone?


r+://588066076 Go Drink A Cup Of Water™
Report Abuse
KingJacko is not online. 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
newcoolman2 is not online. newcoolman2
Joined: 01 Apr 2010
Total Posts: 2637
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
UnbeatableChicken is not online. UnbeatableChicken
Joined: 30 Mar 2014
Total Posts: 10252
29 Dec 2016 02:34 PM
Thanks
i will read up on it


r+://588066076 Go Drink A Cup Of Water™
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
29 Dec 2016 02:35 PM
^ This guy has it.
Report Abuse
RoboGhostie is not online. RoboGhostie
Joined: 11 Jun 2016
Total Posts: 1553
29 Dec 2016 02:36 PM


new has it.


Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
29 Dec 2016 02:38 PM
^ what an extremely useful reply! ^
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
29 Dec 2016 02:42 PM
^ Even usefuler reply! ^
Report Abuse
UnbeatableChicken is not online. UnbeatableChicken
Joined: 30 Mar 2014
Total Posts: 10252
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image