Not a valid member of Player

Yeah I removed the wait before in the server script and still got the issue.

did you try the things i said?

Yep, I’ve checked the name and everything. So confused why this isn’t working, never had this before.

no i mean the methods. have you tried them yet? (on local script btw)

Yes, I’ve tried these. (charrrrs)

I’ve had an issue like this before in the past.
Check out this post. This fixed my issues

Yeah I looked that that. This is where I’m very confused as the folder is being made, it just says it’s not a member of the player when it is. Been using this method for ages and never experienced this.

could you give me a file of those 2 scripts so i can test them myself?

This is a very weird bug. It also happened to me before.

Code’s a couple of posts above.

simply enough i had no errors?
only thing i did is this

task.wait(0.1)

local Player = game.Players.LocalPlayer

local Xpstuff = Player:WaitForChild('XPstuff')

local Exp = Xpstuff.Exp

local RequiredExp = Player.RequiredExp

Exp.Changed:Connect(function(Changed)

if Changed then

script.Parent.XPBar.Bar:TweenSize(UDim2.new(Exp.Value/ RequiredExp.Value,0,1,0))

end

end)

while task.wait() do

script.Parent.Percent.Text = Exp.Value.."/"..RequiredExp.Value

end

local script top
server script down

--variables
local Players = game:GetService("Players")
local DataStoreService = game:GetService("DataStoreService")
local ValueDB = DataStoreService:GetDataStore("Charred_Datastore")

--functions
local function saveData(Player)
	local Values = {
		Player.XPstuff.Level.Value;
		Player.XPstuff.Exp.Value;
	}
	pcall(function()
		ValueDB:SetAsync(Player.UserId, Values)
	end)
end




local function PlayerAdded(Player)
	task.wait()
	--setup
	local data

	local s, e = pcall(function()
		data = ValueDB:GetAsync(Player.UserId)
	end)

	if not s then warn(e) end


	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "XPstuff"
	leaderstats.Parent = Player

	local Level = Instance.new("NumberValue",leaderstats)
	Level.Name = "Level"

	local Exp = Instance.new("NumberValue",leaderstats)
	Exp.Name = "Exp"

	local RequiredExp = Instance.new("NumberValue", Player)
	RequiredExp.Name = "RequiredExp"
	RequiredExp.Value  = Level.Value * 100

	if data and data[1] then
		Level.Value = data[1]
	else
		Level.Value = 1
	end

	if data and data[2] then
		Exp.Value = data[2]
	else
		Exp.Value = 0
	end


	--maincode
	Exp.Changed:Connect(function(Changed)
		if Exp.Value>= RequiredExp.Value then
			Exp.Value = 0
			Level.Value += 1
			RequiredExp.Value = Level.Value * 100



		end
	end)
end



local function PlayerRemoving(Player)
	saveData(Player)
end

for _, Player in ipairs(Players:GetPlayers()) do
	PlayerAdded(Player)
end

Players.PlayerAdded:Connect(PlayerAdded)
Players.PlayerRemoving:Connect(PlayerRemoving)

Still getting the exact same error.

then its really ur games problem.
use it on a new place and test it.

Try running a debug of this:

local ClassVals = {
   ["LocalScript"] = "CLIENT",
   ["Script"] = "SERVER"
}



task.wait()
local plr = game.Players.LocalPlayer
local found = false
for i = 0, 5, 1 do
   for _, v in next, plr:GetChildren() do
      if v.Name == "XPStuff" then
         found = true
      end
   end
end

local str = ""
for i,v in pairs(plr:GetChildren()) do
   str = " " .. v.Name .. ","
end

if found == false then
   print("Not found, Instances found: {" .. str .. "} -- " .. ClassVals[script.ClassName])
else
   print("FOUND, Instances: {" .. str .. "} -- " .. ClassVals[script.ClassName])
end

If it wasn’t found; chance it is the replications.
I’ve set this debug up to check 5 times