Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make this Drive For Money Script work with leaderstats?

Asked by 6 years ago
Edited 6 years ago

I have this old game I am trying to revamp and it doesn't use a lot of newer systems so I'm trying to make a script(i'm semi new to scripting, friend's old game) to make it so players get the amount of money in SPS, but i'm not sure how to make it work with leaderstats.


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
0
at line 14 do M.Cash.Value= M.Cash.Value because cash is the object you want to change its value because that is what the money is. Timmerman73 85 — 6y

Answer this question