|
| 07 Feb 2014 07:39 PM |
I know this is simple, but can someone please tell me why this isn't working?
gamepassid=145239504
function click() if game:GetService("GamePassService"):PlayerHasPass(script.Parent.Parent, gamepassid) then if script.Parent.Parent.Parent.Parent.Shed.Main.Visible == false then script.Parent.Parent.Parent.Parent.Shed.Main.Visible = true else script.Parent.Parent.Parent.Parent.Shed.Main.Visible = false end end script.Parent.MouseButton1Click:connect(onClick) end
I expected it to have the Main frame in "Shed" to to become visible and invisible only if you have a gamepass. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 07:41 PM |
function click() if game:GetService("GamePassService"):PlayerHasPass(script.Parent.Parent, gamepassid) then if script.Parent.Parent.Parent.Parent.Shed.Main.Visible == false then script.Parent.Parent.Parent.Parent.Shed.Main.Visible = true else script.Parent.Parent.Parent.Parent.Shed.Main.Visible = false end end end
script.Parent.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Feb 2014 07:44 PM |
| everything seems fine, Then again I dont really use gamepass things. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 07:46 PM |
| Yeah, I got the exact same result, which was it expected me to click on it but it didn't open. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 07:53 PM |
I know for a fact that the
if script.Parent.Parent.Parent.Parent.Shed.Main.Visible == false then script.Parent.Parent.Parent.Parent.Shed.Main.Visible = true else script.Parent.Parent.Parent.Parent.Shed.Main.Visible = false
part is right, it worked on my other classes. I have enough "ends," I think the problem is the gamepassid=145239504
function click() if game:GetService("GamePassService"):PlayerHasPass(script.Parent.Parent, gamepassid) then |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 07:53 PM |
| So the button doesnt show? or it does show? |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 07:56 PM |
| It does show, the button highlights when I mouse over it and gives me the fingar. When I click though, nothing happens. This does work without the gamepass part, I know because I have other classes that don't need a gamepass, and they work. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 07:57 PM |
gamepassid=145239504
function click() if game:GetService("GamePassService"):PlayerHasPass(script.Parent.Parent, gamepassid) then if script.Parent.Parent.Parent.Parent.Shed.Main.Visible == false then script.Parent.Parent.Parent.Parent.Shed.Main.Visible = true else script.Parent.Parent.Parent.Parent.Shed.Main.Visible = false end end end
scrpt.Parent.MouseButton1Down:connect(click) |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 07:58 PM |
--Sorry, this one.
gamepassid=145239504
function click() if game:GetService("GamePassService"):PlayerHasPass(script.Parent.Parent, gamepassid) then if script.Parent.Parent.Parent.Parent.Shed.Main.Visible == false then script.Parent.Parent.Parent.Parent.Shed.Main.Visible = true else script.Parent.Parent.Parent.Parent.Shed.Main.Visible = false end end end
script.Parent.MouseButton1Down:connect(click) |
|
|
| Report Abuse |
|
|
jjj344
|
  |
| Joined: 19 Dec 2010 |
| Total Posts: 12709 |
|
|
| 07 Feb 2014 08:01 PM |
Your script has a capitalization error. gamepassID=145239504
function click() if game:GetService("GamePassService"):PlayerHasPass(script.Parent.Parent, gamepassid) then if script.Parent.Parent.Parent.Parent.Shed.Main.Visible == false then script.Parent.Parent.Parent.Parent.Shed.Main.Visible = true else script.Parent.Parent.Parent.Parent.Shed.Main.Visible = false end end script.Parent.MouseButton1Click:connect(onClick) end
My ma always said.. life is like a box of chocolates.. *nom nom* never know what you gonna get. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 08:02 PM |
| jj, that is incorrect, he tagged it like that. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 08:09 PM |
| Neither worked, same result for all. |
|
|
| Report Abuse |
|
|
jjj344
|
  |
| Joined: 19 Dec 2010 |
| Total Posts: 12709 |
|
|
| 07 Feb 2014 08:09 PM |
I thought the ID had to capitilized. I'm new here at Scripting so I'm learning.
My ma always said.. life is like a box of chocolates.. *nom nom* never know what you gonna get. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 08:13 PM |
gamepassid=145239504 g = game:GetService("GamePassService")
function click() if g:PlayerHasPass(script.Parent.Parent, gamepassid) then if script.Parent.Parent.Parent.Parent.Shed.Main.Visible == false then script.Parent.Parent.Parent.Parent.Shed.Main.Visible = true else script.Parent.Parent.Parent.Parent.Shed.Main.Visible = false end end end
script.Parent.MouseButton1Down:connect(click)
--[[Give this a shot. I cant test it, i dont have studio on this desktop and I cant download it (nor roblox.)]] |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Feb 2014 08:52 PM |
Latest script didn't work. Also @above, how do you use output during the actual game? |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 08:53 PM |
| theres something roblox created for that, search "roblox error monitoring" in free models. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 08:56 PM |
I used the output in playsolo, error at line 5:
if g:PlayerHasPass(script.Parent.Parent, gamepassid) then |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 08:57 PM |
This is the entire script:
gamepassid=145239504 g = game:GetService("GamePassService")
function click() if g:PlayerHasPass(script.Parent.Parent, gamepassid) then if script.Parent.Parent.Parent.Parent.Shed.Main.Visible == false then script.Parent.Parent.Parent.Parent.Shed.Main.Visible = true else script.Parent.Parent.Parent.Parent.Shed.Main.Visible = false end end end
script.Parent.MouseButton1Down:connect(click)
|
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 08:58 PM |
PlayerHasPass(script.Parent.Parent, gamepassid)
what is the "script.Parent.Parent, gamepassid" for?
|
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 09:03 PM |
| Testing the player for the gamepass. That could be it. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 09:04 PM |
PlayerHasPass(gamepassid)
try that instead? I dont think it will work, i havent used game passes. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 09:04 PM |
| I think I don't have enough .Parents |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 09:12 PM |
The .Parents was the problem. It's fixed now. Thanks to XtremeTemper for the tries and helping me narrow it down to that part of line 5. Thanks to DuelingWarlord for helping me narrow it down to line 5.
----THREAD CLOSED---- |
|
|
| Report Abuse |
|
|