It shows in Developer Console that in line 6 that LocalPlayer is wrong. someone pls help. I don't know what else to put?
local datastore = game:GetService("DataStoreService")
local ds1 = datastore:GetDataStore("CashSaveSystem")
game.Players.LocalPlayer.WaitForChild("leaderstats")
game.Players.LocalPlayer.leaderstats.WaitForChild("Cash")
M = game.Players.LocalPlayer.leaderstats
MinSpeed = 15 --Player must be going this fast in SPS to earn money.
while wait(0.65) do
script.Parent.DropMenu.CashAmount.Value = script.Parent.DropMenu.TextBox.Text
script.Parent.Money.Text = "Money: $"..M.value
if game.Players.LocalPlayer.Character.HumanoidRootPart.Velocity.Magnitude > MinSpeed and game.Players.LocalPlayer.Character.Humanoid.Sit == true then
M.Cash = M.Cash + game.Players.LocalPlayer.Character.HumanoidRootPart.Velocity.Magnitude / 1.4
end
end

1 comment
You can't access game.Players.LocalPlayer from a server script.