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

You need (money amount) left to buy this?

Hi I was trying to make a script so if you try to buy something and you didn't have the right amount then it would say "You need ... more credits to buy this! ". Can you help? This is my guess.

	script.Parent.Text = plr.leaderstats.Credits.Value - 550

2 answers

✓ Accepted answer

Im not the best at coding but I'll give it a go...

script.Parent.Text = "You need "..550 - plr.leaderstats.Credits.Value.." more Credits to buy this!"

Try that... It should work...

Dont hate if it dose't... Im just trying to help o<o

First of, you need to check if the player has enough credits, If they do you set the textbox what ever you want (Eg: You have enough credits). If the check comes back and they do not have enough credits then the textbox is set to "You need more credits"

if plr.leaderstats.Credits.Value >= 550 then
	script.Parent.Text = "You have enough credits"
else
	local total = 550 - plr.leaderstats.Credits.Value 
	script.Parent.Text = "You need"..total" more credits to buy this!"
end 

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