Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help! It says character added is not part of players, what do i do?

local DStoreService = game:GetService("DataStoreService") local CashStore = DStoreService:GetDataStore("Cash")

game.Players.CharacterAdded(function(plr)

local MaxHealth = game.Workspace:WaitForChild("player.Name"):WaitForChild("Humanoid").MaxHealth
local CashValue = plr:WaitForChild("leaderstats"):WaitForChild("Cash").Value
CashStore:SetAsync("plr_"..plr.UserId, CashValue, MaxHealth)

end)

game.Players.PlayerRemoving:Connect(function(plr) local MaxHealth = game.Workspace:WaitForChild("player.Name"):WaitForChild("Humanoid").MaxHealth local CashValue = plr:WaitForChild("leaderstats"):WaitForChild("Cash").Value CashStore:GetAsync("plr_"..plr.UserId, CashValue, MaxHealth) end)

1 answer

✓ Accepted answer

Are you trolling me with that Lua Block?

anyways.

Heres the right way idk how to explain it so.

game.Players.PlayerAdded:Connect(function(player) -- We get the player first
	player.CharacterAdded:Connect(character) -- Now you can do that lol
		--stuff
	end)
end)

Simple mistake you should probably go to dev forum instead. But if this works give me my reward lol

This discussion is preserved as it was. New answers, comments, and votes are closed.