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

Why won't a String values value be changed when a players character loads in?

Asked by 2 years ago

I'm working on a system that changes a value inside a folder in the player GUI, but for some reason, it seems not to work.

local player = game.Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Buttons = script.Parent.Parent.MainGui.Buttons
local ValuesFolder = script.Parent.Parent.ValuesFolder

local PlayerCountry = ValuesFolder.Country:Clone()
PlayerCountry.Name = player.Name.."Country"
PlayerCountry.Parent = ReplicatedStorage.PlayerCountrys
if ValuesFolder.Country.Value == "" then
    ValuesFolder.Country.Value = PlayerCountry.Value
    if PlayerCountry.Value == "" then
        warn("Did not work as intended")
    end
end
0
player.CharacterAdded:connect(function() vendinY 5 — 2y

Answer this question