Gamepass "player every second 2x size"

the script is every 1 sec 2x size gamepass

wait(1) game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Humanoid = Character:WaitForChild(‘Humanoid’)
for i,Child in pairs(Humanoid:GetChildren()) do
if Child.Name == ‘BodyDepthScale’ then
Child.Value = 0.5
elseif Child.Name == ‘HeadScale’ then
Child.Value = 0.5
elseif Child.Name == ‘BodyHeightScale’ then
Child.Value = 0.5
elseif Child.Name == ‘BodyWidthScale’ then
Child.Value = 0.5
end
end
end)
end)

you need bought gamepass to get 2x size every second

You need to increment the values by 2 times, such as Child.Value *= 2

1 Like

i am mean if player bought gamepass he can get 2x size every second

if player do not bought gamepass he get 1x size every second

wait(1) game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Humanoid = Character:WaitForChild(‘Humanoid’)
for i,Child in pairs(Humanoid:GetChildren()) do
if Child.Name == ‘BodyDepthScale’ then
Child.Value = Child.Value * 2
elseif Child.Name == ‘HeadScale’ then
Child.Value = Child.Value * 2
elseif Child.Name == ‘BodyHeightScale’ then
Child.Value = Child.Value * 2
elseif Child.Name == ‘BodyWidthScale’ then
Child.Value = Child.Value * 2
end
end
end)
end)

1 Like

Using this script, change the values of the scales by 2, probably want to connect this to a while task.wait(1) loop, to make it every second.

1 Like

what about gamepass?

player need gamepass for 2x size every second

Oh I see, are you asking how to create a gamepass? Or how to check the player already has a gamepass?

1 Like

i am mean “player need buy gamepass for to get 2x size every second”

So you want to know how to script a working transaction, and have already made the gamepass?

1 Like

yes i am made gamepass, now i need answer,

2x every second player size gamepass

Get the ID of the gamepass, and use MarketPlaceService to check if the player has the gamepass.

1 Like

local player = game.Players.LocalPlayer
local gamePassId = 123456

local success, gamePassInfo = pcall(function()
return game:GetService(“MarketplaceService”):PlayerHasPass(player.UserId, gamePassId)
end)

if success and gamePassInfo then
print(“Player owns game pass”)
else
print(“Player does not own game pass”)
end

1 Like

@Heyman_Manmans Replace the gamePassId with yours, then add the script into the sucess part. This is a simple template.

1 Like

i am didn’t script this script, my friend asked for ask developers help us for develop game

It is still the solution to checking whether a player owns a gamepass. If successful, then you can add the 2 times size script to the player whenever they join.

1 Like

Hi, this should do it.

local MarketplaceService = game:GetService("MarketplaceService")
local GamepassID = 23848234843 -- Define your gamepass ID
local PlayersThatOwnsDoubleScaleGamepass = {}
game.Players.PlayerAdded:Connect(function(Player)
	local success, doesPlayerOwnAsset = pcall(MarketplaceService.PlayerOwnsAsset, MarketplaceService, Player, GamepassID)
	if doesPlayerOwnAsset then
		PlayersThatOwnsDoubleScaleGamepass[Player.Name] = true -- Also make sure to set this to true, when they buy the gamepass, so they don't have to rejoin to get the bonus!
	end
end)
game.Players.PlayerRemoving:Connect(function(Player)
	if PlayersThatOwnsDoubleScaleGamepass[Player.Name] then
		PlayersThatOwnsDoubleScaleGamepass[Player.Name] = nil
	end
end)
local ScaleAmount = 1
while task.wait(1) do
	for _, Player in pairs(game.Players:GetPlayers()) do
		local Character = Player.Character
		if not Character then continue end
		local Humanoid = Character:FindFirstChildOfClass("Humanoid")
		if not Humanoid then continue end
		for _, ScaleObject in pairs(Humanoid:GetChildren()) do
			if ScaleObject:IsA("NumberValue") and string.find(ScaleObject.Name, "Scale") then
				if PlayersThatOwnsDoubleScaleGamepass[Player.Name] then
					ScaleObject.Value += ScaleAmount*2
				else
					ScaleObject.Value += ScaleAmount
				end
			end
		end
	end
end

I’m not gonna give you the answer to, how to handle gamepass purchases, since you should not ask for full scripts. But the above will be the solution to the scaling part.

1 Like

i have question,
localscript or script?

where place it

This is a script, place it in ServerScriptService.

my friend says:

this not working, he placed to serverscriptservice he use R15 and this script.

Well, “Not working” is not good enough description of what’s happening. Has he tried making prints in the while-loop after each if-statement, to see where it does not print?