-
What do you want to achieve? Keep it simple and clear!
I want individual intvalues in one player stat folder to change based on a different player stat folder with stringvalues. -
What is the issue? Include screenshots / videos if possible!
All intvalues found in folder are changing value automatically to 1 even though some should be 0 based on the stringvalue with same name from other folder that have “none” or blank value.
The way it should work is if string value equals intvalue.name then intvalue should become 1, otherwise stay at 0. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Alot of trial & error, research on how to useipairs
and couldnt find this topic.
code is placed in a folder in startergui by the way.
here is code:
local Player = script.Parent.Parent.Parent
repeat wait() until Player.Character
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local PlayerStats = Player:WaitForChild("PlayerStats")
local inventoryFolder = Player:WaitForChild("Inventory")
for i, v in pairs(PlayerStats:GetChildren()) do
if v ~= "None" or " " then
inventoryFolder:FindFirstChild(v.Name).Value = 1
else
inventoryFolder:FindFirstChild(v.Name).Value = 0
end
end
wait(1)
script:Destroy()
Any help is greatly appreciated, Thanks in advance!