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: how do you make a button run a script when clicked??

Previous Thread :: Next Thread 
iixono is not online. iixono
Joined: 03 Jan 2016
Total Posts: 123
19 Jan 2017 04:31 AM
How do I make a button run a script when pressed???


Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
19 Jan 2017 04:32 AM
for text buttons:

textButton.MouseButton1Down

for clickDetectors

clickDetector.MouseClick

BOTH EVENTS, IF YOU DONT KNOW WHAT THEY ARE SEARCH THEM UP IN wiki.roblox.com


#code self = nil
Report Abuse
iixono is not online. iixono
Joined: 03 Jan 2016
Total Posts: 123
19 Jan 2017 04:33 AM
wow thanks for the fast reply!


Report Abuse
iixono is not online. iixono
Joined: 03 Jan 2016
Total Posts: 123
19 Jan 2017 04:50 AM
I wanna know, if I just insert a script, what text do I put in? the textbutton name is falkit


Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
19 Jan 2017 04:53 AM
locationToTextButton.MouseButton1Down:Connect(function()
print 'button pressed'
end)

location ex ScreenGui.Frame.TextButton


#code self = nil
Report Abuse
iixono is not online. iixono
Joined: 03 Jan 2016
Total Posts: 123
19 Jan 2017 05:05 AM
okay got that down and I just finished writing my gui, now how do I add that script in?
the textbutton is called falkit. for the script what would I do


Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
19 Jan 2017 05:17 AM
https://www.youtube.com/watch?v=HKMMu44XEmE


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
iixono is not online. iixono
Joined: 03 Jan 2016
Total Posts: 123
19 Jan 2017 05:25 AM
I understand that but how do I write that later on in the script but on the button I wrote before


Report Abuse
Creatorworld is online. Creatorworld
Joined: 26 Dec 2013
Total Posts: 492
19 Jan 2017 05:51 AM
that is.
the basics
Report Abuse
iixono is not online. iixono
Joined: 03 Jan 2016
Total Posts: 123
19 Jan 2017 04:02 PM
not everyone knows lua man.


Report Abuse
iixono is not online. iixono
Joined: 03 Jan 2016
Total Posts: 123
19 Jan 2017 04:37 PM
anyone??


Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
19 Jan 2017 04:38 PM
this is exactly what events are for, it is a gui button or a clickdetector
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
19 Jan 2017 04:39 PM
is it*
that was a question btw
Report Abuse
gloriousryan is not online. gloriousryan
Joined: 28 Feb 2010
Total Posts: 299
19 Jan 2017 04:43 PM
Alright ill help. This script goes under the gui you want being clicked

local Frame = script.Parent.Parent --Im assuming this will be under a text button gui
--Im using Local for the Variable to make it unique to
--The player

function Pressed() --Defining the Function
--Code that you want activated.
end

MouseButton1Click:connect(Press) --This Detects when a player clicks this, the (Press)
--part is what function it activates
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