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: Opening Shop GUI

Previous Thread :: Next Thread 
brennisawesome is not online. brennisawesome
Joined: 26 Oct 2012
Total Posts: 1658
31 Jul 2017 09:00 PM
I have a script that's supposed to open a shop when you touch the front of the shop, but how do I get it to open when the player gets x studs away from it and then close when they leave it?

Current Script:

function OnTouch(part)

local player = game.Players:GetPlayerFromCharacter(part.Parent)
local GUI = player.PlayerGui:FindFirstChild("All_GUIS")
if player and GUI then
player.PlayerGui.All_GUIS.Shop_GUIS.Shop.Visible = true
player.PlayerGui.All_GUIS.Close.Visible = true


end
end
script.Parent.Touched:connect(OnTouch)
Report Abuse
ImperialThinking is not online. ImperialThinking
Joined: 16 Jun 2016
Total Posts: 144
31 Jul 2017 09:02 PM
Remember that a GUI on the screen is done on the client because the StarterGUI will be cloned into the player; therefore, any changes done on the server cannot be done on the client.

https://www.youtube.com/watch?v=dQw4w9WgXcQ
Report Abuse
brennisawesome is not online. brennisawesome
Joined: 26 Oct 2012
Total Posts: 1658
31 Jul 2017 09:06 PM
I can figure out the latter; your answer doesn't answer my question.
Report Abuse
JoeDev is not online. JoeDev
Joined: 04 Oct 2011
Total Posts: 6475
31 Jul 2017 09:07 PM
you can used ontouch with noncan collide transparent walls that disable the shop gui when touched

these can be placed around the shop in a geometric fashion
Report Abuse
brennisawesome is not online. brennisawesome
Joined: 26 Oct 2012
Total Posts: 1658
31 Jul 2017 09:09 PM
It's there not something like Magnitude or GetPartsInRadius-like function to make it easier?
Report Abuse
BrendonTheWizard is online. BrendonTheWizard
Joined: 28 Jul 2010
Total Posts: 25709
31 Jul 2017 09:13 PM
imperialthinking did answer the question

if this is being done on the server but you want the client to see it then this won't work

i personally recommend having the GUI stored in the player with a localscript that contains a function that is bound to a remote event that the server would fire
Report Abuse
BrendonTheWizard is online. BrendonTheWizard
Joined: 28 Jul 2010
Total Posts: 25709
31 Jul 2017 09:17 PM
magnitude should work for what you're trying to do though worst case scenario invisible parts could be an easy way to create something that feels similar
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