Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ds2 = require(1936396537)
- game.Players.PlayerAdded:Connect(function(plr)
- local leaderstats = Instance.new("Folder", plr)
- local clicks = Instance.new("NumberValue", leaderstats)
- local multiplier = Instance.new("NumberValue", leaderstats)
- leaderstats.Name = "leaderstats"
- clicks.Name = "Clicks"
- multiplier.Name = "Multiplier"
- multiplier.Value = 0
- clicks.Changed:Connect(function()
- local UI = plr:WaitForChild("PlayerGui"):WaitForChild("HUD"):WaitForChild("StatsFrame")
- UI.ClicksFrame.F1.Val.Text = tostring(clicks.Value)
- end)
- multiplier.Changed:Connect(function()
- local UI = plr:WaitForChild("PlayerGui"):WaitForChild("HUD"):WaitForChild("StatsFrame")
- UI.MultiplierFrame.F1.Val.Text = tostring(multiplier.Value).."x"
- end)
- local clicks = ds2("clicks", plr)
- local multiplier = ds2("multiplier", plr)
- local function update(ds, val)
- if ds == "clicks" then
- plr:WaitForChild("leaderstats"):WaitForChild("Clicks").Value = val
- elseif ds == "multiplier" then
- plr:WaitForChild("leaderstats"):WaitForChild("Multiplier").Value = val
- end
- end
- ds2.Combine("stats", "clicks", "multiplier")
- update("clicks", clicks:Get(0))
- update("multiplier", multiplier:Get(0))
- clicks:OnUpdate(function(newVal)
- update("clicks", newVal)
- end)
- multiplier:OnUpdate(function(newVal)
- update("multiplier", newVal)
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement