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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: ClickDetector Excecution on Outside UI

Previous Thread :: Next Thread 
InfectedGeek is not online. InfectedGeek
Joined: 23 Oct 2014
Total Posts: 469
04 Aug 2015 11:56 AM
local npc = game.Workspace.JoBlacksmith

npc.ClickDetector.MouseClick:connect(function()
game.Workspace.StarterGui.cc.Frame.Visible=true
end)

-- This is my script, however, it does not work. The build, as such, more visually, is ...

game // Workspace // StarterGui // cc // Frame

game // Workspace // JoBlacksmith
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Aug 2015 12:00 PM
Well, I hear a lot of people have trouble with ClickDetectors or MouseClick because they do not use WaitForChild.

local npc = game.Workspace:WaitForChild("JoBlacksmith")
local gui = game.Workspace:WaitForChild("StarterGui"):WaitForChild("cc"):WaitForChild("Frame").Visible = true
end)


I'm just here so I don't get fined
Report Abuse
InfectedGeek is not online. InfectedGeek
Joined: 23 Oct 2014
Total Posts: 469
04 Aug 2015 12:00 PM
Thank you! I went outside of lua for a while, and I'm relearning it.
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Aug 2015 12:01 PM
No problem. Does it work?


I'm just here so I don't get fined
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
04 Aug 2015 12:02 PM
If it's a normal script, then WaitForChild isn't needed.
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Aug 2015 12:03 PM
"local"

but I'm sure it's a LocalScript, or it would best off be, because it's looking for the click of an individiual player.


I'm just here so I don't get fined
Report Abuse
InfectedGeek is not online. InfectedGeek
Joined: 23 Oct 2014
Total Posts: 469
04 Aug 2015 12:03 PM
Where I put .visible = true it says that = is not meant to be there, any fix?
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Aug 2015 12:04 PM
post the error, and I'll look into it.


I'm just here so I don't get fined
Report Abuse
InfectedGeek is not online. InfectedGeek
Joined: 23 Oct 2014
Total Posts: 469
04 Aug 2015 12:05 PM
Expected Identifier, got '='
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Aug 2015 12:07 PM
hm, remove the =true see if that works.


I'm just here so I don't get fined
Report Abuse
InfectedGeek is not online. InfectedGeek
Joined: 23 Oct 2014
Total Posts: 469
04 Aug 2015 12:09 PM
Nope.
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Aug 2015 12:09 PM
Is there any red lines in the script


I'm just here so I don't get fined
Report Abuse
InfectedGeek is not online. InfectedGeek
Joined: 23 Oct 2014
Total Posts: 469
04 Aug 2015 12:13 PM
Yeah, on end), tried removing it.
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Aug 2015 12:13 PM
Try

end
end)


I'm just here so I don't get fined
Report Abuse
InfectedGeek is not online. InfectedGeek
Joined: 23 Oct 2014
Total Posts: 469
04 Aug 2015 12:14 PM
Now the red line is under end
Report Abuse
WindProdigy is not online. WindProdigy
Joined: 19 Feb 2014
Total Posts: 11
04 Aug 2015 12:15 PM
Infected can you post the current script you got now?
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Aug 2015 12:16 PM
are you using a LocalScript


I'm just here so I don't get fined
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Aug 2015 12:17 PM
local npc = game.Workspace:WaitForChild("JoBlacksmith")
local gui = game.Workspace:WaitForChild("StarterGui"):WaitForChild("cc"):WaitForChild("Frame")

gui.Visible = true

try no end


I'm just here so I don't get fined
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
04 Aug 2015 12:17 PM
Idiot. You need to find the player before you make a gui visible with click detectors


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
WindProdigy is not online. WindProdigy
Joined: 19 Feb 2014
Total Posts: 11
04 Aug 2015 12:18 PM
Why are you trying to change the size of the gui in StarterGui?
Report Abuse
InfectedGeek is not online. InfectedGeek
Joined: 23 Oct 2014
Total Posts: 469
04 Aug 2015 12:19 PM
Wow, I consider you an idiot. Seriously, not everyone is perfect.
Report Abuse
InfectedGeek is not online. InfectedGeek
Joined: 23 Oct 2014
Total Posts: 469
04 Aug 2015 12:19 PM
Size? I'm trying to change visibility.
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Aug 2015 12:20 PM
Well he said that StarterGui is in Workspace.

Then try this

local player = game.Players.LocalPlayer
local npc = game.Workspace.JoBlacksmith
local gui = player.StarterGui.cc.Frame

gui.Visible = true


I'm just here so I don't get fined
Report Abuse
WindProdigy is not online. WindProdigy
Joined: 19 Feb 2014
Total Posts: 11
04 Aug 2015 12:20 PM

local player = game.Players.LocalPlayer
script.Parent.ClickDetector.MouseClick(function(click)
local npc = game.Workspace:WaitForChild("JoBlacksmith")
local gui = player.PlayerGui:WaitForChild("cc"):WaitForChild("Frame")

gui.Visible = true

end)
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
04 Aug 2015 12:21 PM
local part = workspace.Part

part.ClickDetector.MouseClick:connect(function(player)
player.PlayerGui:WaitForChild("ScreenGui").Frame.Visible = true
end)


"Talk is cheap. Show me the code." - Linus Torvalds
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