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 » Scripting Helpers
Home Search
 

Re: why doesnt this work?

Previous Thread :: Next Thread 
areaquest2 is not online. areaquest2
Joined: 05 Jun 2010
Total Posts: 196
02 Aug 2013 06:54 PM
Button1 = game.StarterGui.ScreenGui.Image1

function onTouch()
Button1.Visible = true
wait(.5)
Button1.Visible = false
end

Button1.Touched:connect(onTouch)



output:
18:52:49.593 - Touched is not a valid member of ImageButton
18:52:49.593 - Script "Workspace.House1.Button1.Script", Line 9
18:52:49.593 - stack end
Report Abuse
areaquest2 is not online. areaquest2
Joined: 05 Jun 2010
Total Posts: 196
02 Aug 2013 06:54 PM
bump
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
02 Aug 2013 06:55 PM
Wrong event.
Button1.MouseButton1Click:connect(onTouch)
Report Abuse
Jtmt88 is not online. Jtmt88
Joined: 07 Jun 2008
Total Posts: 4346
02 Aug 2013 06:55 PM
Button1.MouseButton1Down:connect(function()
Button1.Visible = true
wait(.5)
Button1.Visible = false
end)

Touched is for parts. MouseButton1Down is for GUIs.
Report Abuse
areaquest2 is not online. areaquest2
Joined: 05 Jun 2010
Total Posts: 196
02 Aug 2013 06:57 PM
well it has to happen when someone touchs a brick not clicking on it.
Report Abuse
Jtmt88 is not online. Jtmt88
Joined: 07 Jun 2008
Total Posts: 4346
02 Aug 2013 06:59 PM
One question: how do you touch a GUI with your character?
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
02 Aug 2013 07:00 PM
"Touched is not a valid member of ImageButton"

An ImageButton is totally a brick.
Report Abuse
areaquest2 is not online. areaquest2
Joined: 05 Jun 2010
Total Posts: 196
02 Aug 2013 07:01 PM
i said they touch a "brick" and the gui becomes visible they dont touch the gui...
Report Abuse
areaquest2 is not online. areaquest2
Joined: 05 Jun 2010
Total Posts: 196
02 Aug 2013 07:08 PM
bump
Report Abuse
areaquest2 is not online. areaquest2
Joined: 05 Jun 2010
Total Posts: 196
02 Aug 2013 07:27 PM
bump
Report Abuse
WishNite is not online. WishNite
Joined: 11 Feb 2009
Total Posts: 15828
02 Aug 2013 07:28 PM
this script has too many errors

try this instead

function onTouch(hit)
local p = game.Players:GetPlayerFromCharacter(hit.Parent)
if hit then
p.PlayerGui.ScreenGui.Image1.Visible = true
end
end



script.Parent.Touched:connect(onTouch)
Report Abuse
DrWaffler is not online. DrWaffler
Joined: 16 Sep 2011
Total Posts: 4248
02 Aug 2013 07:29 PM
Stop arguing with the people who actually know how to script.

They didn't lie to you.

I am reborn as an ocelot. You disapprove.
Report Abuse
areaquest2 is not online. areaquest2
Joined: 05 Jun 2010
Total Posts: 196
02 Aug 2013 07:34 PM
im not arguing im saying what it was supposed to do.
Report Abuse
areaquest2 is not online. areaquest2
Joined: 05 Jun 2010
Total Posts: 196
02 Aug 2013 07:39 PM
well it connects but it doesnt turn on the Gui
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
02 Aug 2013 07:39 PM
Well we are trying to say that you are trying to connect to a non-existent event. There is no Touched event of any Gui. You must connect to the event of the brick you want to touch, otherwise, the script doesn't know what brick you're trying to touch (or, in this case, what you're even attempting to accomplish.)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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