|
| 26 Oct 2015 03:07 PM |
I have an ImageButton that doesn't work at all. Hovering and clicking don't work. The script is working 100%. I tried the script in an other Interface Button. But with the ImageButton, it's not working. Can someone give me a clue about this? Thank you in advance. Here's the script if you are really sure the problem is in the script.
wait(1) player = game.Players.LocalPlayer local opened = script.Parent.Parent.Parent.InUse.Value local skin = script.Parent.Parent.Parent.Parent.ThePrice.Skin.Value local activated = false
if player:WaitForDataReady() then if player.Skins.PKm2.Value == true then script.Parent.Hide.Visible = true end end
function Click() if not opened then if script.Parent.Hide.Visible == false and not activated then activated = true skin.Value = "PKm2" script.Parent.Parent.Parent.Parent.ThePrice:TweenPosition(UDim2.new(0.3, 0, 0.25, 0), "In", "Linear") opened = true repeat wait(0.05) until not opened skin.Value = "" end end end
script.Parent.MouseButton1Click:connect(Click) |
|
|
| Report Abuse |
|
|
goro7
|
  |
| Joined: 01 Jul 2009 |
| Total Posts: 735 |
|
|
| 26 Oct 2015 03:11 PM |
| Is there some invisible frame or something in front of it? |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2015 03:15 PM |
| Oh. Yeah there is. Thank you! I forgot about that one. |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2015 03:18 PM |
| Never mind, I deleted the frame and it still not working. |
|
|
| Report Abuse |
|
|
goro7
|
  |
| Joined: 01 Jul 2009 |
| Total Posts: 735 |
|
|
| 26 Oct 2015 03:23 PM |
| Are you absolutely sure that there is nothing else in front of the button? I am 99% sure that is the cause if your script is working perfectly. |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2015 03:28 PM |
| The ImageButton is in a Frame. But the ImageButton ZIndex is higher than the frame. The Frame is in a ScrollFrame. I don't know if you can see what I mean. I tried to put my ImageButton Out of the ScrollFrame and it still not working. |
|
|
| Report Abuse |
|
|
goro7
|
  |
| Joined: 01 Jul 2009 |
| Total Posts: 735 |
|
|
| 26 Oct 2015 03:29 PM |
| Can you publish your StarterGui into a free model for me to look at? |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2015 03:32 PM |
Sure. Here's the link (the Gui is not completed yet but still working.): http://www.roblox.com/Skin-GUI-System-item?id=314572092 |
|
|
| Report Abuse |
|
|
goro7
|
  |
| Joined: 01 Jul 2009 |
| Total Posts: 735 |
|
| |
|
|
| 26 Oct 2015 03:34 PM |
| Go in Skins > SF > PKmFrame > PKm2 and there's the script in it. |
|
|
| Report Abuse |
|
|
goro7
|
  |
| Joined: 01 Jul 2009 |
| Total Posts: 735 |
|
|
| 26 Oct 2015 03:45 PM |
1.) In your Open script, you do not set the InUse value to true or false. 2.) In your Buy script, you cannot set a variable to the value at the beginning. You need to set it to the object and use .Value. By setting it to the value, you are simply setting that variable. Pretend a BoolValue representing false is in the script:
Your code:
local a = script.BoolValue.Value a = true if a then print("Worked") end
Output> [NONE]
This would not print "Worked" because you are changing a, not the BoolValue.
Correct code:
local a = script.BoolValue a.Value = true if a then print("Worked") end
Output> Worked
This would print "Worked" because you are changing the value of the BoolValue, not a.
There may have been more errors but without being in your game I could not have known them. |
|
|
| Report Abuse |
|
|