I'm trying to replace a value inside a folder that inside a folder inside the player GUI, but it won't change I have a warn() in place for that but it won't warn me. Whats happening. P.s. the script is in a local script inside a folder inside the playergui.
local Player = game.Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local workSpace = game:GetService("Workspace")
local Buttons = script.Parent.Parent.MainGui.Buttons
local ValuesFolder = script.Parent.Parent.ValuesFolder
if Player.Character then
if ReplicatedStorage:FindFirstChild(Player.Name.."Country") then
local PlayerCountry = ReplicatedStorage:FindFirstChild(Player.Name.."Country")
if ValuesFolder.Country.Value == "" then
ValuesFolder.Country.Value = PlayerCountry.Value --doesn't work
if PlayerCountry.Value == "" then
warn("Did not work as intended") --does not print
end
end
end
elseif Player.Character == nil then
if ReplicatedStorage:FindFirstChild(Player.Name.."Country") then
local PlayerCountry = ReplicatedStorage:FindFirstChild(Player.Name.."Country")
if ValuesFolder.Country.Value == "" then
ValuesFolder.Country.Value = PlayerCountry.Value --doesn't work
if PlayerCountry.Value == "" then
warn("Did not work as intended") --does not print
end
end
elseif ReplicatedStorage:FindFirstChild(Player.Name.."Country") == nil then
local PlayerCountry = ValuesFolder.Country:Clone()
PlayerCountry.Name = Player.Name.."Country"
PlayerCountry.Parent = ReplicatedStorage.PlayerCountrys --works
end
end

1 comment
Is there an instance in the ReplicatedStorage that's named plrnameCountry? And why is it located in the ReplicatedStorage instead of PlayerCountrys as specified in the last block of code?