Leaderstats:
game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player
01 | local clicks = Instance.new( "IntValue" ) |
02 | clicks.Name = "Clicks" |
03 | clicks.Value = 0 |
04 | clicks.Parent = leaderstats |
05 |
06 | local rebirths = Instance.new( "IntValue" ) |
07 | rebirths.Name = "Rebirths" |
08 | rebirths.Value = 0 |
09 | rebirths.Parent = leaderstats |
10 |
11 | local gems = Instance.new( "IntValue" ) |
12 | gems.Name = "Gems" |
13 | gems.Value = 0 |
14 | gems.Parent = leaderstats |
end)
Clicking button:
local button = script.Parent local player = game.Players.LocalPlayer local clicks = player:WaitForChild("leaderstats"):WaitForChild("Clicks") local rebirths = player:WaitForChild("leaderstats"):WaitForChild("Rebirths") local Amount = script.Parent.Amount.Value
script.Parent.MouseButton1Click:Connect(function() clicks.Value = clicks.Value + Amount if rebirths.Value > 0 then clicks.Value = clicks.Value + Amount + rebirths.Value end end)
Amount is 1.
This should make it so if you own a gamepass, the amount given is doubled but it shouldn't be run from a local script. Should be pretty easy to convert to a server script. Basically the same thing but replace game.Players.LocalPlayer with script.Parent.Parent.Parent.Parent or however many you need until you get to the player.
01 | local button = script.Parent |
02 | local player = game.Players.LocalPlayer |
03 | local clicks = player:WaitForChild( "leaderstats" ):WaitForChild( "Clicks" ) |
04 | local rebirths = player:WaitForChild( "leaderstats" ):WaitForChild( "Rebirths" ) |
05 | local Amount = script.Parent.Amount.Value -- 1 |
06 |
07 | local MarketplaceService = game:GetService( 'MarketplaceService' ) |
08 | local GAMEPASS_ID = 0 -- id of your gamepass here |
09 |
10 | script.Parent.MouseButton 1 Click:Connect( function () |
11 | local givenamount = Amount |
12 |
13 | if rebirths.Value > 0 then |
14 | givenamount + = rebirths.Value |
15 | end |