Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do you make a button load a map, weapon, and death limit?

Asked by 8 years ago
Edited 8 years ago

DISCLAIMER: My real account is DragonBallFan100. The reason I made this account is because the code to verify my account kept getting blocked because I'm under 13, and I do not want to wait 2 more years.

ANYWAY: As I stated in my previous question, I am helping my friend bshamu make a war clan. We both work on the place. And I'm making a GUI that loads weapons and maps, and a death limit. How do I do all those? For example:

Click on sword, I get the sword. Click on the map Bricktops, I get Bricktops. Click on the death limit, After they reach the death limit, they will be teamed spectators and respawned to the lobby. Oh, and one more thing I forgot to mention. I want to make this visible to ONLY HIGH RANKS LIEUTENANT+. The thing is, how do I do all of this? Thank you for your feedback.

0
This isn't a request website. Link150 1355 — 8y
0
I am simply asking a question. I come here for answers. learntolua101 3 — 8y

1 answer

Log in to vote
-2
Answered by 8 years ago
Edited 8 years ago

I can help with the sword.

So, let's get started, shall we?

You want to insert a SCRIPT into the button.

First line of the code should be at the very top and it should determine where the actual sword (the tool) is located and where the click detector is at. The click detector should always been in the block you're wanting to activate.

local sword = game.ReplicatedStorage.Tools.Sword:Clone()

Next, we want to determine when the buttonk is being clicked. So, we do this:

script.Parent.MouseButton1Click:connect(function()
end

After all of this, we want to put all of this together, so, we do this:

local sword = game.ReplicatedStorage.Tools.Sword:Clone()

script.Parent.MouseButton1Click:connect(function()
sword.Parent = script.Parent.Parent.Parent.Parent.Character
end


If my code worked, please accept my answer! :)

0
Well, I'm clicking a GUI, so I don't need a click detector. learntolua101 3 — 8y
0
Ah, my apologies. Let me redo all of that then. TheRings0fSaturn 28 — 8y
0
The code I have listed is now prepared for a button inside of a GUI. TheRings0fSaturn 28 — 8y
0
If you want you could do an anonymous function if you only have that 1 function only doing 1 thing DeveloperSolo 370 — 8y
0
Also, if you read my entire question, I want it only to be visible for high ranks in the group learntolua101 3 — 8y
Ad

Answer this question