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

I need to change the account balance its a text label please help?

No output I want it to change its text to the money.Value and it won't work please help?

script.Parent.MouseButton1Click:connect(function()
	local plr = script.Parent.Parent.Parent.Parent
	local check1 = game.Players:FindFirstChild(plr)
	if check1 then
		local ls = check1:WaitForChild("leaderstats")
		local Money = ls:WaitForChild("Money")
		if Money then
			Money.Value = Money.Value + 1
			 local Amount = game.Players.plr.PlayerGui.CaseClicker.Amount
			Amount.Text = "Account Balance: "..Money.Value
		end
	end
	wait(1)
end)

1 answer

local Amount = game.Players.plr.PlayerGui.CaseClicker.Amount

Should really be

local Amount = plr.PlayerGui.CaseClicker.Amount

Because plr is a variable, not just the name of the player.

Also,

Amount.Text = "Account Balance: "..Money.Value

Should be

 Amount.Text = "Account Balance: " .. tostring(Money.Value)

Because Money.Value is not a string, and has to be converted into one before it can be joined with other strings using the .. operator.

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