Categories > Coding > Lua >

[TUT] Button click script tutorial

Posts: 19

Threads: 3

Joined: Nov, 2020

Reputation: 0

Posted

Hello, fellow forum searcher! You've provably got here, because you're looking for a script that does something, when a button is clicked. Aren't you? Before we start, basically, you need a variable so you don't have to use the full script as im doing that always. So, at the begging, you type:

 

local button = script.Parent

 

Alright. Now, as we got the variable, you need the script for the button script, right? That's simple, really simple right now. You just type:

 

button.MouseButton1Click:Connect(function()

        

end)

 

Well, as you can see, you have the button script already. Wait, there's still what we have to do in these scripts. We need to add something right there! Otherwise, there will be just a normal output from the script, and it will be just actually useless. So that's what you can type for an example:

 

print("Button clicked! Function triggered!")

 

That's all you should type in these scripts. If you want, you can just copy and paste the "source code" from the script and that's all that you need. I hope that I've helped you.

 

Full script:

 

local button = script.Parent

 

button.MouseButton1Click:Connect(function()

      print("Button clicked! Function triggered!")

end)

 

Thank you for reading! I hope I helped you with something that you need for your script, or something else, so basically you should accept me in that WRD community and you shouldn't call me somebody that is a "noob" or a "newbie."

  • 0

arent u sad when somebody doesn't reply to ur dms?

yeah i got that boi.

Posts: 715

Threads: 30

Joined: Sep, 2020

Reputation: 13

Replied

you are a big skid 

  • 0

| Discord (Updated): apppon#8358 | C++ Enthusiast | 

Posts: 870

Threads: 34

Joined: Aug, 2020

Reputation: 6

Replied

@MyUserIsTaken is he that guy with the axon skidder role

  • 0

Posts: 715

Threads: 30

Joined: Sep, 2020

Reputation: 13

Replied

@MaximusExploit

mhm and he asked me stupid questions

  • 0

| Discord (Updated): apppon#8358 | C++ Enthusiast | 

Posts: 870

Threads: 34

Joined: Aug, 2020

Reputation: 6

Replied

@MyUserIsTaken add my new account real quick. iS-e-x#7430, remove -, my account got hacked.

  • 0

Posts: 0

Threads: 0

Joined: ?

Reputation:

Replied

Idk this seems a bit useless :/

 

If U actually said what it does instead of giving parts of the script saying to go to the next instruction it might be a bit more useful

 

Otherwise why not just leave the entire script there without splitting it into different sections with useless comments XD

  • 0

davidTube

not inactive

noticed

Posts: 1849

Threads: 88

Joined: Dec, 2018

Reputation: 56

Replied

very very very very very very basic, can just get all of this with a google search but good for starter game devs ig

  • 0

Moon

Moon

vip

Posts: 7441

Threads: 314

Joined: Aug, 2020

Reputation: 80

Replied

@Astronemi 

hey post farm bad

  • 0

Added

@Astronemi

 

WTF 8 NOTIFICATIONS AAAAAAAA

  • 0

TaxiDriver08

JustMarie

Posts: 1547

Threads: 39

Joined: Dec, 2020

Reputation: 6

Replied

well i'd kinda disagree with this thread post..

its all well and good that you shown people how to do this but like jumping straight to something without actually working towards it (in other words people mess up and create inefficent code and spaghetti code because they don't really understand)

  • 0

JustMarie#0709

 

simple_x

milktea

Posts: 394

Threads: 22

Joined: Sep, 2019

Reputation: 4

Replied

this thread is useless

it takes a newbie in scripting 5 minutes to search on youtube or roblox api to know how to do this

  • 0

 

i own synapse x
biggest idiot in town

discord: nakiri#4485

Posts: 19

Threads: 3

Joined: Nov, 2020

Reputation: 0

Replied

@MyUserIsTaken Nobody cares about your opinions, and no I am not a skid. People call me like that because they THINK that I copy and paste scripts or something, but I just tried to look at axon. Even looking at it is being a skid? Like literally. You're being rude because you have a bad life in your house, don't you?

  • 0

arent u sad when somebody doesn't reply to ur dms?

yeah i got that boi.

Posts: 226

Threads: 45

Joined: Mar, 2020

Reputation: -16

Replied

didnt understand fully still giving errors in vistual studio please give more info

  • 0

Exploit i have : Synapse X , Sir hurt . 

Hubs i use , Dark hub , Alpha X 

Guis I made : Tower of hell > https://pastebin.com/5gV0H08w

Posts: 715

Threads: 30

Joined: Sep, 2020

Reputation: 13

Replied

you are a skid and many people agree now get the f out you fcking 7 year old

  • 0

| Discord (Updated): apppon#8358 | C++ Enthusiast | 

dogy

#1 doggo

Posts: 63

Threads: 8

Joined: Dec, 2020

Reputation: 0

Replied

@Exploithunter

LMAO USE THIS IN ROBLOX STUDIO YOU FCKING DUMB4SS

  • 0

Official Xenfall download:

https://xenfall.weebly.com/download.html

*pls dont hate im not good in making exploits smh*

Next >>>

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )