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: Touched:connect help

Previous Thread :: Next Thread 
SuperLol211 is not online. SuperLol211
Joined: 30 Jul 2013
Total Posts: 93
23 Jan 2017 01:15 PM
Hi,
I'm trying to make a script(s) where, when you touch a part, a gui will appear, which can be closed. I've managed to fully complete the bit where you close the gui, but I cant seem to figure out how to use Touched:connect to open the GUI. Here's the script.

#code game.Workspace.itemStoreDetector.Touched:connect(function(GUIopen)
#code game.StarterGui.ScreenGui.Enabled = true
#code end)

Any help would be appreciated, thanks.


#code print "Hello World!"
Report Abuse
Terminatekill is not online. Terminatekill
Joined: 03 Mar 2016
Total Posts: 54
23 Jan 2017 01:17 PM
Maybe use

function onClicked(playerWhoClicked)
Report Abuse
SuperLol211 is not online. SuperLol211
Joined: 30 Jul 2013
Total Posts: 93
23 Jan 2017 01:18 PM
That'd work, but I'm trying to do a Touched event. I'll try it anyways though.
Wouldn't I need to insert a ClickDetector tho?


#code print "Hello World!"
Report Abuse
Terminatekill is not online. Terminatekill
Joined: 03 Mar 2016
Total Posts: 54
23 Jan 2017 01:19 PM
To be honest I'm not that great either but yes I think so
Report Abuse
Terminatekill is not online. Terminatekill
Joined: 03 Mar 2016
Total Posts: 54
23 Jan 2017 01:20 PM
U may need this


script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
Terminatekill is not online. Terminatekill
Joined: 03 Mar 2016
Total Posts: 54
23 Jan 2017 01:20 PM
Don't know what order the stuff goes in though
Report Abuse
Terminatekill is not online. Terminatekill
Joined: 03 Mar 2016
Total Posts: 54
23 Jan 2017 01:20 PM
Soz
Report Abuse
SuperLol211 is not online. SuperLol211
Joined: 30 Jul 2013
Total Posts: 93
23 Jan 2017 01:25 PM
Don't worry, I know how to use onClicked lol.
Also, it's still not working. It can't be a script issue, I'm getting no errors in the output box so it must be something with the GUI. Thanks for the help. :)


#code print "Hello World!"
Report Abuse
Terminatekill is not online. Terminatekill
Joined: 03 Mar 2016
Total Posts: 54
23 Jan 2017 01:26 PM
Is it a gui
Report Abuse
Terminatekill is not online. Terminatekill
Joined: 03 Mar 2016
Total Posts: 54
23 Jan 2017 01:26 PM
If so put it in starter gui
Report Abuse
SuperLol211 is not online. SuperLol211
Joined: 30 Jul 2013
Total Posts: 93
23 Jan 2017 01:27 PM
The GUI opener isn't a GUI, it's a part. But to close it the GUI needs to be open. And yes, it is in starter GUI. :)


#code print "Hello World!"
Report Abuse
Terminatekill is not online. Terminatekill
Joined: 03 Mar 2016
Total Posts: 54
23 Jan 2017 01:28 PM
I don't know then
Report Abuse
SuperLol211 is not online. SuperLol211
Joined: 30 Jul 2013
Total Posts: 93
23 Jan 2017 01:28 PM
Basically, in my game there's a store. Infront of the store, there is a transparent part, with the clickdetector and the script to open the GUI inside. The actual GUI is in StarterGUI.


#code print "Hello World!"
Report Abuse
Terminatekill is not online. Terminatekill
Joined: 03 Mar 2016
Total Posts: 54
23 Jan 2017 01:29 PM
Soz don't know
Report Abuse
SuperLol211 is not online. SuperLol211
Joined: 30 Jul 2013
Total Posts: 93
23 Jan 2017 01:30 PM
It's fine dude. Atleast you tried to help. :)


#code print "Hello World!"
Report Abuse
Terminatekill is not online. Terminatekill
Joined: 03 Mar 2016
Total Posts: 54
23 Jan 2017 01:31 PM
Soz I couldn't be more of help is there anyone who can help him?
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
23 Jan 2017 01:44 PM
"game.StarterGui"

use player gui after you get the player from hit


Report Abuse
SuperLol211 is not online. SuperLol211
Joined: 30 Jul 2013
Total Posts: 93
23 Jan 2017 01:45 PM
???
Not sure what you mean?
As in, replace starterGui with playerGui?


#code print "Hello World!"
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
23 Jan 2017 01:47 PM
dont use the #code

workspace.ItemStoreDetector.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
local gui = player.PlayerGui:WaitForChild('ScreenGui')
gui.Enabled = true
end
end)


Report Abuse
SuperLol211 is not online. SuperLol211
Joined: 30 Jul 2013
Total Posts: 93
23 Jan 2017 01:49 PM
Thanks for the script. I'll test it out now.


#code print "Hello World!"
Report Abuse
SuperLol211 is not online. SuperLol211
Joined: 30 Jul 2013
Total Posts: 93
23 Jan 2017 02:04 PM
It worked! Thanks so much dude!


#code print "Hello World!"
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