It says so many numbers when I divide it by the price. But what term do I need (Multiplication, dividing, adding or subtracting) Or can someone help me.
--//Variables\\-- local player = game.Players.LocalPlayer local gui = player:FindFirstChild("PlayerGui"):FindFirstChild("CarUI") local button = gui:FindFirstChild("TextButton") local money = player:FindFirstChild("leaderstats"):FindFirstChild("money") local storage = game:GetService("ReplicatedStorage") local model = storage:FindFirstChild("OffRoader") local price = 50 --//Main Script\\-- button.MouseButton1Click:connect(function() if money.Value >= price then warn("Enough Money!") local clonecar = model:Clone() clonecar.Parent = workspace clonecar:MakeJoints() elseif money.Value <= 49 then warn("Not enough money!") button.Text = "Not Enough Money. You Have: $"..money.Value.." You need $"..money.Value /49 --// THIS IS THE PROBLEM button.BackgroundColor3 = Color3.new(255/255, 0/255, 0/255) wait(2) button.BackgroundColor3 = Color3.new(170/255, 255/255, 127/255) button.Text = "Spawn Off Roader" end end)
Just concatenate your price
variable in :D
local player = game.Players.LocalPlayer local gui = player:FindFirstChild("PlayerGui"):FindFirstChild("CarUI") local button = gui:FindFirstChild("TextButton") local money = player:FindFirstChild("leaderstats"):FindFirstChild("money") local storage = game:GetService("ReplicatedStorage") local model = storage:FindFirstChild("OffRoader") local price = 50 button.MouseButton1Click:connect(function() if money.Value >= price then warn("Enough Money!") local clonecar = model:Clone() clonecar.Parent = workspace clonecar:MakeJoints() else warn("Not enough money!") local msg,need = "Not Enough Money. You Have: $"," You need $" button.Text = msg..money.Value..need..price button.BackgroundColor3 = Color3.new(255/255, 0/255, 0/255) wait(2) button.BackgroundColor3 = Color3.new(170/255, 255/255, 127/255) button.Text = "Spawn Off Roader" end end)