How to save player tycoon and load it when he enters the game?

Hi.i want to make tycoon game but i cant save data

can you help me please to save data of player and load it when player enters the game?

i wanted to save it with values but its too long

Try start here:

oh really ,i forgot youtube thanks!

1 Like

when i wrote first script (in tutorial which you send me script name is Main script) i got the error : attempt to index nil with Name
what can i do please help

there is error with this line: MainItems.OwnerDoor.MainPart.SurfaceGui.TextLabel.Text = Player.Name…" s’Tycoon"

mind sending the whole script? or not?

of course!

—Varibles—

local TycoonModel = script.Parent.Parent
local Items = {}

local BoughtItems = TycoonModel:FindFirstChild(“BoughtItems”)
local Values = TycoonModel:FindFirstChild(“Values”)
local MainItems = TycoonModel:FindFirstChild(“MainItems”)
local Scripts = TycoonModel:FindFirstChild(“Scripts”)

MainItems.OwnerDoor.MainPart.Touched:Connect(function(hit)
if hit.Parent.Parent:FindFirstChild(“Humanoid”) and Values.Owner.Value == nil then
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
Values.Owner.Value = Player
MainItems.OwnerDoor.MainPart.SurfaceGui.TextLabel.Text = Player.Name…“s’Farm”

end

end)

local TycoonModel = script.Parent.Parent
local Items = {}

local BoughtItems = TycoonModel:FindFirstChild(“BoughtItems”)
local Values = TycoonModel:FindFirstChild(“Values”)
local MainItems = TycoonModel:FindFirstChild(“MainItems”)
local Scripts = TycoonModel:FindFirstChild(“Scripts”)

MainItems.OwnerDoor.MainPart.Touched:Connect(function(hit)
if hit.Parent.Parent:FindFirstChild(“Humanoid”) and Values.Owner.Value == nil then
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
Values.Owner.Value = Player
MainItems.OwnerDoor.MainPart.SurfaceGui.TextLabel.Text = hit.Parent.Name…“s’Farm”

end
end)

just a sudle change

thanks its working !
(for 31 chrs)