And no, before you link me to some wack thread, I have read up on each one and none of them have the right solution, for they are completely different matters.
game.Players.PlayerAdded:Connect(function(plr)
local copieddata = script.Data:Clone()
copieddata.Parent = plr
local data = game:GetService("DataStoreService")
local cashdata = data:GetDataStore("Cash")
local success, cashdata = pcall(function()
return cashdata:GetAsync(plr)
end)
if success then
if cashdata == nil then
cashdata:SetAsync(plr, 0)
end
copieddata.Cash.Value = cashdata
end
--data
local copiedplotinfo = script.PlotInformation:Clone()
copiedplotinfo.Parent = plr
if workspace.Plots.Plot1.Owner.Value == "Nil" then
copiedplotinfo.Plot.Value = "Plot1"
workspace.Plots.Plot1.Owner.Value = plr.Name
elseif workspace.Plots.Plot2.Owner.Value == "Nil" then
copiedplotinfo.Plot.Value = "Plot2"
workspace.Plots.Plot2.Owner.Value = plr.Name
elseif workspace.Plots.Plot3.Owner.Value == "Nil" then
copiedplotinfo.Plot.Value = "Plot3"
workspace.Plots.Plot3.Owner.Value = plr.Name
elseif workspace.Plots.Plot4.Owner.Value == "Nil" then
copiedplotinfo.Plot.Value = "Plot4"
workspace.Plots.Plot4.Owner.Value = plr.Name
end
--plot placement
local currentplot = copiedplotinfo.Plot.Value
local plot = workspace.Plots:FindFirstChild(currentplot)
local function farmincome() --farm gainer stuff
local farm = plot.Farm
local farmlvl = farm.LVL.Value
local income = 0
if farmlvl == 1 then
income = 50
end
local Cash = copieddata.Cash
Cash.Value = Cash.Value + income
print("Gave farm cash respectively. New cash=".. Cash.Value)
print("Amount of cash recieved=".. income)
cashdata:SetAsync(plr, Cash.Value)
end
local function westernshootoutscoutedition()
--MAKE SCOUT DELAY TIME AND CASH GAIN ETC
end
while true do
wait(5)
farmincome() --farm income delay and thing
wait()
end
--next oen here
--farms, zombie dmg, etc. (active slots r used for like showing if it actually function)
end)
ERROR AT LINE 52!
