My issue:
Im trying to give the players a folder called “PlayerVariables” if it doesn’t already exist in their character. Here’s the code:
local players = game:GetService("Players")
local players = game:GetService("Players")
players.PlayerAdded:Connect(function(plr)
if plr.Character:FindFirstChild("PlayerVariables") == nil then
return true
else
local vars = game.ReplicatedStorage.PlayerVariables:Clone()
vars.Parent = plr.Character
end
end)
local plrs = game:GetService('Players')
plrs.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local PlayerVariablesRep = game:GetService('ReplicatedStorage').PlayerVariables:Clone()
if character:FindFirstChild('PlayerVariables') then
return "Found Folder"
else
PlayerVariablesRep.Parent = character
end
end)
end)