Untitled

 avatar
unknown
plain_text
a month ago
920 B
1
Indexable
local TextButton = script.Parent
local scoreLabel = game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel 
local upgradeButton = game.Players.LocalPlayer.PlayerGui.ScreenGui.upgradeButton
local upgradeLabel = game.Players.LocalPlayer.PlayerGui.ScreenGui.UpgradeLabel 
local score = 0
local upgradeCost = 10
local pointsPerClick = 1



local function updateScore()
	scoreLabel.Text = "Score: " .. score
	upgradeLabel.Text = "Upgrade Cost: " .. upgradeCost 
end

print("Attempting to connect the button click event...")
TextButton.MouseButton1Click:Connect(function()
	print("working") -- please fucking work
	score = score + pointsPerClick
	updateScore() 
end)

upgradeButton.MouseButton1Click:Connect(function()
	if score >= upgradeCost then
		score = score - upgradeCost 
		upgradeCost = upgradeCost + 5 
		pointsPerClick = pointsPerClick + 1 
		updateScore() 
	end
end)

updateScore()
Leave a Comment