I tried to alter a script where when u click you get 1 click, but with 50 coins you can buy 1.5x clicks. Here is my script:
local button = script.Parent
local player = button:FindFirstAncestorOfClass("Player")
repeat
player = button:FindFirstAncestorOfClass("Player")
task.wait()
until player ~= nil
local debounce = true
button.MouseButton1Click:Connect(function()
if debounce then -- if debounce is true
debounce = false
local leaderstats = player:WaitForChild("leaderstats")
local Clicks = leaderstats:WaitForChild("Clicks")
Clicks.Value += 1
if game.StarterGui.Shop.ShopFrame.X1dot5.MouseButton1Click then -- here is what I add and it does not work
if game.Players.LocalPlayer.leaderstats.Coins.Value == 50 then
Clicks.Value +=0.5
end
end
task.delay(0.5, function() -- after 1 second, debounce will turn true
debounce = true
end)
end
end)
Thanks for helping!

1 comment
Try using prints to narrow down the issue like this print("Test")