Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local CollectionService = game:GetService("CollectionService")
- local Connections = {}
- function removeConnection(obj)
- if Connections[obj] then
- Connections[obj]:disconnect()
- Connections[obj] = nil
- end
- end
- for i, v in pairs(workspace.Clickers:GetDescendants()) do
- if v.Name == "Click" then
- CollectionService:AddTag(v, "Clicker")
- end
- end
- for i, v in pairs(CollectionService:GetTagged("Clicker")) do
- v.Parent.UI.Frame.Val.Text = tostring(v:WaitForChild("ClicksLeft").Value)
- Connections[v] = v.MouseClick:Connect(function(plr)
- if v.ClicksLeft.Value >= 1 and v:WaitForChild("Enabled").Value == true then
- plr.leaderstats.Clicks.Value = plr.leaderstats.Clicks.Value + (1 + (1*plr.leaderstats.Multiplier.Value)) --math...
- v.ClicksLeft.Value = v.ClicksLeft.Value - 1
- v.Parent.UI.Frame.Val.Text = tostring(v.ClicksLeft.Value)
- if v.ClicksLeft.Value <= 0 then
- v.Enabled.Value = false
- spawn(function()
- for i = 1, 10, 1 do
- wait(.5)
- v.ClicksLeft.Value = v.ClicksLeft.Value + 1
- v.Parent.UI.Frame.Val.Text = tostring(v.ClicksLeft.Value)
- end
- if v.ClicksLeft.Value == 10 then
- v.Enabled.Value = true
- end
- end)
- end
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment