|
| 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 |
|
|
|
| 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 |
|
|
|
| 04 Aug 2015 12:00 PM |
| Thank you! I went outside of lua for a while, and I'm relearning it. |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2015 12:01 PM |
No problem. Does it work?
I'm just here so I don't get fined |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2015 12:02 PM |
| If it's a normal script, then WaitForChild isn't needed. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 04 Aug 2015 12:03 PM |
| Where I put .visible = true it says that = is not meant to be there, any fix? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 04 Aug 2015 12:05 PM |
| Expected Identifier, got '=' |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 04 Aug 2015 12:13 PM |
Yeah, on end), tried removing it.
|
|
|
| Report Abuse |
|
|
|
| 04 Aug 2015 12:13 PM |
Try
end end)
I'm just here so I don't get fined |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2015 12:14 PM |
| Now the red line is under end |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2015 12:15 PM |
| Infected can you post the current script you got now? |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2015 12:16 PM |
are you using a LocalScript
I'm just here so I don't get fined |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 04 Aug 2015 12:18 PM |
| Why are you trying to change the size of the gui in StarterGui? |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2015 12:19 PM |
| Wow, I consider you an idiot. Seriously, not everyone is perfect. |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2015 12:19 PM |
| Size? I'm trying to change visibility. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|