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?
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)
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