Hey I need help with this script. How can I make this script where it instead of clicking for cash I can just hold down and it gives Doge Coins (cash) with a 1 second delay.
Script:
local player = game.Players.LocalPlayer
script.parent.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
while game:GetService'UserInputService':IsMouseButtonPressed'MouseButton1' do
player.leaderstats.DogeCoins.Value += 8
wait(1)
end
end)
end)
local debounce = true
script.parent.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
while game:GetService'UserInputService':IsMouseButtonPressed'MouseButton1' do
if debounce == true then
debounce = false
player.leaderstats.DogeCoins.Value += 8
wait(1)
debounce = true
end
end)
end)
I got this error:
Workspace.TronixJohn.Porta-Miner 3000.LocalScript:13: Expected identifier when parsing expression, got ā)ā
Also this is the script I have right now:
local debounce = true
local player = game.Players.LocalPlayer
script.parent.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
while game:GetServiceāUserInputServiceā:IsMouseButtonPressedāMouseButton1ā do
if debounce == true then
debounce = false
player.leaderstats.DogeCoins.Value += 8
wait(1)
debounce = true
end
end)
end)
local debounce = true
script.parent.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
while game:GetService'UserInputService':IsMouseButtonPressed'MouseButton1' do
if debounce == true then
debounce = false
player.leaderstats.DogeCoins.Value += 8
wait(1)
debounce = true
end
end
end)
end)
When I hold it for less than a second it freezes my studio i got this: Script timeout: exhausted allowed execution time
My current script is this:local player = game.Players.LocalPlayer
local debounce = true
script.parent.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
while game:GetServiceāUserInputServiceā:IsMouseButtonPressedāMouseButton1ā do
if debounce == true then
debounce = false
player.leaderstats.DogeCoins.Value += 8
wait(1)
debounce = true
end
end
end)
end)
Actually you can probably just put a wait() outside instead
local debounce = true
script.parent.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
while game:GetService'UserInputService':IsMouseButtonPressed'MouseButton1' do
if debounce == true then
debounce = false
player.leaderstats.DogeCoins.Value += 8
wait(1)
debounce = true
end
wait()
end
end)
end)