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
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: ImageButton not working

Previous Thread :: Next Thread 
PleasantKillerman is not online. PleasantKillerman
Joined: 01 Nov 2011
Total Posts: 668
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 is online. 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
PleasantKillerman is not online. PleasantKillerman
Joined: 01 Nov 2011
Total Posts: 668
26 Oct 2015 03:15 PM
Oh. Yeah there is. Thank you! I forgot about that one.
Report Abuse
PleasantKillerman is not online. PleasantKillerman
Joined: 01 Nov 2011
Total Posts: 668
26 Oct 2015 03:18 PM
Never mind, I deleted the frame and it still not working.
Report Abuse
goro7 is online. 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
PleasantKillerman is not online. PleasantKillerman
Joined: 01 Nov 2011
Total Posts: 668
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 is online. 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
PleasantKillerman is not online. PleasantKillerman
Joined: 01 Nov 2011
Total Posts: 668
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 is online. goro7
Joined: 01 Jul 2009
Total Posts: 735
26 Oct 2015 03:33 PM
What button is it?
Report Abuse
PleasantKillerman is not online. PleasantKillerman
Joined: 01 Nov 2011
Total Posts: 668
26 Oct 2015 03:34 PM
Go in Skins > SF > PKmFrame > PKm2 and there's the script in it.
Report Abuse
goro7 is online. 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
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