Leaderstats:
game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player
local clicks = Instance.new("IntValue") clicks.Name = "Clicks" clicks.Value = 0 clicks.Parent = leaderstats local rebirths = Instance.new("IntValue") rebirths.Name = "Rebirths" rebirths.Value = 0 rebirths.Parent = leaderstats local gems = Instance.new("IntValue") gems.Name = "Gems" gems.Value = 0 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.
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 -- 1 local MarketplaceService = game:GetService('MarketplaceService') local GAMEPASS_ID = 0 -- id of your gamepass here script.Parent.MouseButton1Click:Connect(function() local givenamount = Amount if rebirths.Value > 0 then givenamount += rebirths.Value end -- checks if user owns the gamepass if MarketplaceService:UserOwnsGamePassAsync(player.UserId, GAMEPASS_ID) then givenamount *= 2 end clicks.Value += givenamount end)