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

How to change the name of button for one person?

Asked by 6 years ago

I'm making a script in which that if I click a button it subtracts by one but if it is already selected it and you click it it will add it back I want to make the button change its name to and from "Select" and "Selected" without showing it on other clients I've gotten it to subtract the one and change the name of the button (but it does it for everyone in the server) I tried making it so if the name of the button is "Selected" and it is clicked it will add but if its name is "Select" it will remove it and change the name to "Selected" How would I go about this?

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
local Boolean = false

TextButton.MouseButton1Click:connect(function()
    Boolean = not Boolean
    if Boolean == false then
        TextButton.Name = "Select"
    elseif Boolean == true then
        TextButton.Name = "Selected"
    end
end)
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Simple! Just make it a Local Part. Here's the Wiki page on that: http://wiki.roblox.com/index.php?title=Local_parts

Here's an example:

-- Put this in a Local Script you can put this in StarterGui or StarterPack
for i,v in pairs(game.Lightning.LocalParts:GetChildren)do   -- I made a folder that holds all my Local Parts named "LocalParts" in lightning
v:Clone().Parent = game.Workspace.Camera
end
0
Hello, I put it inside a local script still nothing. What can I do? Treylerp 0 — 6y
1
I added an example script. Let me know if that helped! MRbraveDragon 374 — 6y

Answer this question