Untitled

 avatar
unknown
plain_text
a month ago
1.4 kB
4
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 autoClicker = game.Players.LocalPlayer.PlayerGui.ScreenGui.autoClicker
local score = 0
local upgradeCost = 10
local pointsPerClick = 1
local autoCost = 500
local autoClickTime = 0.1
local autoClickerActive = false


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)

autoClicker.MouseButton1Click:Connect(function()
	if score >= autoCost then
		score = score - autoCost
		autoClickerActive = true 
	end
end)

while true do 
	wait(autoClickTime)


if autoClickerActive then
		score = score + pointsPerClick
		updateScore()
	end






updateScore()
end
Leave a Comment