Hey Aethuza here! I recently got into scripting and I’m working on script providing points.
So I made this script that awards you money when clicking on your MouseButton1, however I would like the script to give points over time as long as you hold down the button, example:
If held down award player with 10 points for each second. I have these two scripts:
Script 1:
local cooldown = false
script.Parent.MouseButton1Down:Connect(function()
if cooldown == false then
cooldown = true
game.Workspace.Events.AddPoints:FireServer()
script.Parent.Active = false
wait(.02)
script.Parent.Active = true
cooldown = false
end
end)
Script 2:
script.AddPoints.OnServerEvent:Connect(function(plr)
plr.leaderstats.Points.Value = plr.leaderstats.Points.Value +10 + plr.leaderstats.Prestige.Value
end)
script.Prestige.OnServerEvent:Connect(function(plr)
plr.leaderstats.Prestige.Value = plr.leaderstats.Prestige.Value +1
plr.leaderstats.Points.Value = 0
plr:LoadCharacter()
end)
Thank you in advance!