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: I can't get my GUI button to work.

Previous Thread :: Next Thread 
anthony5008 is not online. anthony5008
Joined: 15 Dec 2007
Total Posts: 170
12 Jun 2013 11:37 PM
I want my button to print a simple command when I click it.
I used this formula:

function onButtonClicked()
print ("Hey")
wait(5)
print.Remove()
end
//~
Okay, this is extremely nooby and you're probably wondering why an '07er can't script... I haven't really been into scripting my entire Roblox career until now, thanks.
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
12 Jun 2013 11:40 PM
You never called the function.
Assuming the script is inside the button:

function onButtonClicked()
print ("Hey")
wait(5)
print.Remove()
end
script.Parent.MouseButton1Click:connect(onButtonClicked)
Report Abuse
anthony5008 is not online. anthony5008
Joined: 15 Dec 2007
Total Posts: 170
12 Jun 2013 11:41 PM
You my friend, are amazing!! This is my first script, I'm surprised you didn't find any errors!
Report Abuse
anthony5008 is not online. anthony5008
Joined: 15 Dec 2007
Total Posts: 170
12 Jun 2013 11:42 PM
It still doesn't print anything. :/
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
12 Jun 2013 11:46 PM
It prints for me... also, print.Remove() wont work. I don't think you can delete things in the output via scripting, but I could be wrong.
Report Abuse
anthony5008 is not online. anthony5008
Joined: 15 Dec 2007
Total Posts: 170
12 Jun 2013 11:52 PM
I think that it is print:Remove()? I can't seem to get my script to even print though. :/
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
12 Jun 2013 11:53 PM
How is your Gui set up? This may be the problem.
Report Abuse
anthony5008 is not online. anthony5008
Joined: 15 Dec 2007
Total Posts: 170
12 Jun 2013 11:54 PM
GuiMain
TextButton
Script.
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