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 |
|
|
|
| 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
|
  |
| Joined: 03 Jan 2016 |
| Total Posts: 123 |
|
|
| 19 Jan 2017 04:33 AM |
wow thanks for the fast reply!
|
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
| |
|
iixono
|
  |
| Joined: 03 Jan 2016 |
| Total Posts: 123 |
|
|
| 19 Jan 2017 04:02 PM |
not everyone knows lua man.
|
|
|
| Report Abuse |
|
|
iixono
|
  |
| Joined: 03 Jan 2016 |
| Total Posts: 123 |
|
| |
|
|
| 19 Jan 2017 04:38 PM |
| this is exactly what events are for, it is a gui button or a clickdetector |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2017 04:39 PM |
is it* that was a question btw |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|