|
| 01 Apr 2014 07:35 AM |
I'm making it so when someone opens up a GUI, a certain ImageButton will have different images depending on whether or not you own an item. I got the open/close script to work, but not the PlayerOwnsAsset script. Here's the Explorer window:
StarterGui --ArrowGUI (Frame) ----Arrows (Frame inside ArrowGUI) ----BlueFrame (Same as Arrows) ------Page1 (Frame inside BlueFrame) --------Pic1 (ImageButton inside Page1) ----OpenClose (Frame inside ArrowGUI) ------Open (Textbutton inside OpenClose) --------Script (Script in Open)
Here's the script:
Pic1 = script.Parent.Parent.Parent.BlueFrame.Page1.Pic1
script.Parent.MouseButton1Down:connect(function(plr) if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,151625745) then Pic1.Image = "rbxassetid://151594398" else Pic1.Image = "rbxassetid://151169783" end end)
Does anyone know what's wrong? Thanks! |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
| |
|
MrChubbs
|
  |
| Joined: 14 Oct 2010 |
| Total Posts: 4969 |
|
|
| 01 Apr 2014 08:37 AM |
| local plr = game.Players.LocalPlayer |
|
|
| Report Abuse |
|
|
|
| 02 Apr 2014 07:34 AM |
I changed it to a LocalScript, and it now looks like this:
Pic1 = script.Parent.Parent.Parent.BlueFrame.Page1.Pic1 local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Down:connect(function(plr) if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,151625745) then Pic1.Image = "rbxassetid://151594398" else Pic1.Image = "rbxassetid://151169783" end end)
Still doesn't work. Anything else that's wrong? |
|
|
| Report Abuse |
|
|