Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i add cash to my leaderboard with a part??

	local cash = Instance.new("IntValue")
	cash.Name = "Cash"
	cash.Value = 0

	local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(newPlayer.Name)
	if cashmoney ~= nil then
		cashmoney.Changed:connect(function()
			cash.Value = cashmoney.Value
		end)
	end

This is my script for having a leaderboard with cash on it, and it starts with 0, and also its a tycoon game. How do i make it so that if any player touches a certain part, somewhere in the middle of the map, it adds cash to their leaderboard?

4 comments

0

do you mean just to add to the cash value? like cash.Value = cash.Value + 1

0

No because then I'm petty sure that would change the cash amount of a player when they just join. I need it to add on later, fro

0

just put it under a touch function and add it to the player who touched the brick.

0

Yup that's exactly what I did, thank you.

1 answer

✓ Accepted answer

https://www.youtube.com/watch?v=rWbQ0x-Xjj4

i Highly recommend watching this video it tells you how to make a leaderboard,give cash every 1 sec (like a actual tycoon game),tells you how to give cash when you touch a brick

don't skip through to find the part where he tells you how to add cash its best you watch the tutorial twice and get to the point where you can write the script without looking at the video so when need to something besides adding cash you know how to do it

1 comment

0

Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.