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

Can anyone help with this cash system?

Okay so using tostring to make a Value become 2.00 instead of 2. I have been trying for a while to make it go the was I wanted it to go and it wouldn't work, at first I used a for loop and the same thing is happening. So far, I haven't seen no error, it is just not coming out as 2.00 instead of 2 the way I wanted it.


local Cash = script.Parent.Cash
local CashL = script.Parent.CashL
local Pay = script.Parent.Pay
local PayL = script.Parent.PayL
local Time = script.Parent.Time
local Paytime = 60

local Teams = {
	"Uniondale Police Department",
	"Uniondale Department of Public Safety",
	"Uniondale Department of Transportation and Maintenance",
	"Uniondale Developers",
	"UnionDale Department of Justice",
	"Citizens",
	"Uniondale Department of Corrections",
	"Uniondale Department of Homeland Security",
	"Uniondale National Guard",
	"Visitors"
	
}
	
local TeamsPayAmount = {
		10.00,
		9.00,
		9.00,
		13.00,
		11.00,
		5.00,
		11.00,
		12.00,
		15.00,
		2.00
				
}



--Pay System--
--Visitor Pay--
if game.Players.LocalPlayer.TeamColor == BrickColor.new("Smoky grey")then
	Pay.Value = TeamsPayAmount[10]
	PayL.Text = "Pay Amount: "..Pay.Value
	tostring(Pay.Value)
	end

1 answer

✓ Accepted answer

on line 42, try using this line instead:

PayL.Text = ("Pay Amount: "..Pay.Value..".00$")

4 comments

0

Although sometimes something in the county may be $45. 50 or $25. 76 I need those cents to be there not 00. But thank you!

0

make another string for cents value and make it like:

0

("Pay Amount: "..Pay.Value.."."..Cent.Value.."$")

0

Okay I got you let me test the things out.

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