Hello. So, I have a tycoon made from Zednovs Tycoon Kit. I was trying to figure out how to give a player cash through the dev console or simply from a command. It would be great if someone could help me out! Thanks!
When in game, you can type game.Players.(player name).leaderstats.Cash.Value = value through the devconsole which is opened by pressing f9
game.Players.PlayerName.leaderstats.Cash.Value = 50
It should be something relevant to this if you wanna do it via Dev Console, doing it with commands though you’d need to use RemoteEvents to fire from the client’s input to the server
I tried that but it does not save to the player. It acts as a non-existence
The it must be a problem with your datastores then i would think
Also tried that but, it does not save.
Everything works fine, like the cash collector. Maybe a way to add money to the cash collector?
Is the Cash Collecter implemented via a Touched
Event? Also is there a leaderstats
object parented inside your player?
Is there a intvalue inside the cash collector that says how much cash has been collected so far? If so, you can just add the value directly to there
I think it might be parented to the tycoon owner. But idk. And yes, there is a touched event. When you touch the red pad, it gives you the money
its used through a string value i think
Oh, that explains it
You need to convert the number using a tostring
function
game.Players.PlayerName.leaderstats.Cash.Value = tostring(50)
Although I’d recommend changing the StringValue into a Int/NumberValue of some sort
No! that’s not how you can do that
This is a script that you can be used to give player cash / money :
local plr = game.ServerStorage.PlayerMoney:FindFirstChild(PLAYERNAME) -- Get Player Name
plr.Value = plr.Value + 1000 -- Amount
I tried that and now I cant buy anything no matter how much money I have lol
Hm. Looks like it should work. Maybe I am doing something. Can you join me & help me figure it out? I will give you dev access. [2k] ⚔️War Tycoon⚔️ - Roblox
I meant that for the Dev Console, which is implicitly why I put it in 1 line alone
Also depending on where you put your leaderstats
folder, should determine where you want to increase your Cash value
I’m pretty sure that Zednov’s Tycoon uses “shortened” cash values, for example, 1,000,000 would be shortened to 1M+
it does. Does that matter in the code though?
I believe that @JavaKingz answer should work perfectly fine.
game.ServerStorage.PlayerMoney:FindFirstChild(PLAYERNAME).Value += 10000
^ The code above should work fine in the developer console.
It gives me an error saying “Argument 1 missing or nil”