Not a valid of member of player

For some reason otherstuff is not a part of the player eventhough it is

local rp = game:GetService("ReplicatedStorage")
local event = rp.Rebirth
local plr = game:GetService("Players").PlayerAdded:Wait()

local othersutff = plr.OtherStuff
local rebirth = othersutff.rebirths
local rebirthcost = plr.OtherStuff.rebirthcost
local cash = plr.leaderstats.Cash
local wood = plr.leaderstats.Wood

event.OnServerEvent:Connect(function()

	print(cash.Value)
	print(rebirthcost.Value)
	if cash.Value >= rebirthcost.Value then   
		rebirthcost.Value *= 3.75
		rebirth.Value = rebirth.Value + 0.1
		math.ceil(rebirth.Value)
		math.ceil(rebirthcost.Value)
		cash.Value = 0
		wood.Value = 0
		print(rebirth.Value)
	else
		print("not enough money")
	end
end)

It’s possible that it ISN’T a member of player - it still has to be created and stuff.

You could try making use of :WaitForChild, or could do repeat wait() until plr:FindFirstChild("OtherStuff")

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.