How would I find the first value that has a value set to false, and then change it?
So... I have a script, where I need to find the first value in a set of values inside TextBoxes
I have tried a lot of things, but I can't get the value ("ChangeValue",see code) to change to true
I am going to shorten down the script to only what that series of code uses to find and change that value.
Any help is greatly appreciated.
Please note: prevname is a value I have already set in some other script that also runs stuff for me
Please note: the children in SwordsButtons all have a number as their name
Please note: Occupied is also a value (Boolean value) I have previously set in some other script
There are 0 errors
Shortened-down-code: (There might be some spelling mistakes, I wrote this in by hand, not copy paste)
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local PlrGui = Player.PlayerGui
local StoreSword = PlrGui:FindFirstChild("SwordStore")
local SwBackground = StoreSword.Background
local SwordsButtons = SwBackground.Swords
local PlayerSwordFolder = game.ReplicatedStorage.Swords:WaitForChild(Player.Name)
local Number = game.ReplicatedStorage.Swords.Number
local numberswords = PlayerSwordFolder:WaitForChild("NumberSwords")
Mouse.Button2Up:connect(function()
if numberswords.Value < 24 then
numberswords.Value = numberswords.Value + 1
swordtostore.Name = swordtostore.prevname.Value .. numberswords.Value
local ChangeValue = SwordsButtons:FindFirstChild(numberswords.Value).Occupied.Value == false
ChangeValue = true
end
end)

3 comments
I have.. it is just too long so it hops to the next line (only on this site)
yea he has. he has a folder named the Player's Name inside of the Swords Folder
ohh my bad :D