If own one gamepass, ignore other gamepass

the script below changes the players size and does alot of other things. i only want one thing to change. there is one gamepass in the script which raises the max size of a player to 65 as u can see. is it possible to make it if someone owns another gamepass (input id somewhere idk) that raises the max size again but also ignores the old 65 gamepass? because as of now i own both gamepass and if i wanna test out the new max size i think the old max size is blocking it because the game still thinks my max is 65. PLEASE DONT CHANGE ANYTHING UNNECESARY TO THE SCRIPT, why? because this script is made by my old scripter, he left me for unfortunate reasons making me alone. i just want a change to his script for this new gamepass. if it breaks i cant go back to him to fix it because hes gone. so long story short: there is a gamepass that raises max to 65, i want a gamepass that raises it to 99999. The ID of 65 gamepass is listed in script, this is ID of new gamepass: 11958230


local CS = game:GetService("CollectionService")
local RS = game:GetService("RunService")
local Market = game:GetService("MarketplaceService")
local Debris = game:GetService("Debris")
local Settings = {
Gamepass = {SizeGamepassId = 9228818, GamepassMaxSize = 65, InvincGamepassId = 9300503,}
}

local Other = game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("Other")
local Notify = game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("Notify")
local WalkspeedIncrement = 1.3
local JumpPowerIncrement = 2.5
local HeightIncrement = 0.1
local MaximumHeight = 40
local MinimumHeight = -8
local FastGrowIncrement = 0.4

for i, v in pairs(workspace:GetDescendants()) do
	if CS:HasTag(v, "GrowButton") then
		local ClickDetector = v:FindFirstChildOfClass("ClickDetector")
		if not ClickDetector then ClickDetector = Instance.new("ClickDetector") ClickDetector.Parent = v end
		local function SetDensity(character)
		    if not character then return end
		    for i, v in pairs(character:GetChildren()) do
		        if v:IsA("Part") or v:IsA("MeshPart") then
		            local pr = PhysicalProperties.new(50, v.Friction, v.Elasticity, 1, 1)
		            v.CustomPhysicalProperties = pr
		        end
		    end
		end
		local function GetHeight(Character)
		    if not Character then return end
		    local Height = Character:FindFirstChild("Height")
		    if not Height then return end
		    return Height
		end
		
		ClickDetector.MouseClick:Connect(function(Player)
			if Player:DistanceFromCharacter(v.CFrame.p) > ClickDetector.MaxActivationDistance + 10 then
				return
			end
		    local character = Player.Character
			if not character then return end
		    if not CS:HasTag(character, "DensitySet") then
		        SetDensity(character)
			end
			if Other:InvokeClient(Player, "IsSprinting") then
				Notify:FireClient(Player, {Title = "Notification", Text = "Cannot shrink or grow while sprinting / boosting.", Duration = 5, Button1 = "Ok"})
				return
			end
		    local Humanoid = character:FindFirstChild ('Humanoid')
		    local Height = GetHeight(character)
		    if not Height then
		        Height = Instance.new("NumberValue")
		        Height.Name = "Height"
		        Height.Value = 0
		        Height.Parent = character
			end
		    if Humanoid then		
		        local BDS = Humanoid:FindFirstChild('BodyDepthScale')
		        local BWS = Humanoid:FindFirstChild('BodyWidthScale')
		        local BHS = Humanoid:FindFirstChild('BodyHeightScale')
		        local HS = Humanoid:FindFirstChild('HeadScale')
				if Height.Value >= MaximumHeight then
					if Market:UserOwnsGamePassAsync(Player.UserId, Settings.Gamepass.SizeGamepassId) then
						if Height.Value >= Settings.Gamepass.GamepassMaxSize then
							return
						end
					else return
					end
				end
				if CS:HasTag(Player, "FastGrow") and Height.Value + 4 > MaximumHeight then
					if Market:UserOwnsGamePassAsync(Player.UserId, Settings.Gamepass.SizeGamepassId) then
						if Height.Value + 4 > Settings.Gamepass.GamepassMaxSize then
							return
						end
					else return
					end
				end
		        if BDS and BWS and BHS and HS then
		            if not CS:HasTag(Player, "FastGrow") then
						BDS.Value = BDS.Value + HeightIncrement
			            BWS.Value = BWS.Value + HeightIncrement
			            BHS.Value = BHS.Value + HeightIncrement
						HS.Value = HS.Value + HeightIncrement
					else
						if CS:HasTag(Player, "FastGrow") then
							BDS.Value = BDS.Value + FastGrowIncrement
				            BWS.Value = BWS.Value + FastGrowIncrement
				            BHS.Value = BHS.Value + FastGrowIncrement
							HS.Value = HS.Value + FastGrowIncrement
						end
					end
					local UpperTorso = character:FindFirstChild("UpperTorso")
					local PE = script:FindFirstChild("GrowParticle")
					local OPE = script:FindFirstChild("ParticleEmitter")
					if UpperTorso and PE and OPE then
						spawn(function()
							if UpperTorso:FindFirstChild("GrowParticle") then
								if UpperTorso:FindFirstChild("GrowParticle").Enabled then
									return
								end
							end
							local n = Instance.new("Attachment")
							n.Parent = UpperTorso
							PE = PE:Clone()
							PE.Parent = n
							OPE = OPE:Clone()
							OPE.Parent = UpperTorso
							wait(1)
							PE.Enabled = false
							OPE.Enabled = false
							Debris:AddItem(n, 0.5)
							Debris:AddItem(OPE, 2)
						end)
					end
				 end
				 if CS:HasTag(Player, "FastGrow") then
					Height.Value = Height.Value + 4
					else Height.Value = Height.Value + 1
				end
			end
			if CS:HasTag(Player, "FastGrow") then
				Humanoid.JumpPower = Humanoid.JumpPower + (JumpPowerIncrement * 4)
				Humanoid.WalkSpeed = Humanoid.WalkSpeed + (WalkspeedIncrement * 4)
			else
			    Humanoid.JumpPower = Humanoid.JumpPower + JumpPowerIncrement
				Humanoid.WalkSpeed = Humanoid.WalkSpeed + WalkspeedIncrement
			end
		end)
	end
	if CS:HasTag(v, "ShrinkButton") then
		local ClickDetector = v:FindFirstChildOfClass("ClickDetector")
		if not ClickDetector then ClickDetector = Instance.new("ClickDetector") ClickDetector.Parent = v end
		local function SetDensity(character)
		    if not character then return end
		    for i, v in pairs(character:GetChildren()) do
		        if v:IsA("Part") or v:IsA("MeshPart") then
		            local pr = PhysicalProperties.new(50, v.Friction, v.Elasticity, 1, 1)
		            v.CustomPhysicalProperties = pr
		        end
		    end
		end
		
		local function GetHeight(Character)
		    if not Character then return end
		    local Height = Character:FindFirstChild("Height")
		    if not Height then return end
		    return Height
		end
		
		ClickDetector.MouseClick:Connect(function(Player)
			if Player:DistanceFromCharacter(v.CFrame.p) > ClickDetector.MaxActivationDistance + 10 then
				return
			end
			if Other:InvokeClient(Player, "IsSprinting") then
				Notify:FireClient(Player, {Title = "Notification", Text = "Cannot shrink or grow while sprinting / boosting.", Duration = 5, Button1 = "Ok"})
				return
			end
		    local character = Player.Character
			if not character then return end
		    if not CS:HasTag(character, "DensitySet") then
		        SetDensity(character)
		    end
		    local Humanoid = character:FindFirstChild ('Humanoid')
		    local Height = GetHeight(character)
		    if not Height then
		        Height = Instance.new("NumberValue")
		        Height.Name = "Height"
		        Height.Value = 0
		        Height.Parent = character
		    end
			 if Height.Value <= MinimumHeight then return end
		    if Humanoid then		
		        local BDS = Humanoid:FindFirstChild('BodyDepthScale')
		        local BWS = Humanoid:FindFirstChild('BodyWidthScale')
		        local BHS = Humanoid:FindFirstChild('BodyHeightScale')
		        local HS = Humanoid:FindFirstChild('HeadScale')
				if Height.Value <= MinimumHeight then
					return
				end
				if CS:HasTag(Player, "FastGrow") and Height.Value - 4 < MinimumHeight then
					return
				end
		        if BDS and BWS and BHS and HS then
		            if not CS:HasTag(Player, "FastGrow") then
						BDS.Value = BDS.Value - HeightIncrement
			            BWS.Value = BWS.Value - HeightIncrement
			            BHS.Value = BHS.Value - HeightIncrement
						HS.Value = HS.Value - HeightIncrement
					else
						if CS:HasTag(Player, "FastGrow") then
							BDS.Value = BDS.Value - FastGrowIncrement
				            BWS.Value = BWS.Value - FastGrowIncrement
				            BHS.Value = BHS.Value - FastGrowIncrement
							HS.Value = HS.Value - FastGrowIncrement
						end
					end
					local UpperTorso = character:FindFirstChild("UpperTorso")
					local PE = script:FindFirstChild("ShrinkParticle")
					local OPE = script:FindFirstChild("ParticleEmitter")
					if UpperTorso and PE and OPE then
						spawn(function()
							if UpperTorso:FindFirstChild("ShrinkParticle") then
								if UpperTorso:FindFirstChild("ShrinkParticle").Enabled then
									return
								end
							end
							local n = Instance.new("Attachment")
							n.Parent = UpperTorso
							PE = PE:Clone()
							PE.Parent = n
							OPE = OPE:Clone()
							OPE.Parent = UpperTorso
							wait(1)
							PE.Enabled = false
							OPE.Enabled = false
							Debris:AddItem(n, 0.5)
							Debris:AddItem(OPE, 2)
						end)
					end
				 end
				 if CS:HasTag(Player, "FastGrow") then
					Height.Value = Height.Value - 4
					else Height.Value = Height.Value - 1
				end
		    end
		    if CS:HasTag(Player, "FastGrow") then
				Humanoid.JumpPower = Humanoid.JumpPower - (JumpPowerIncrement * 4)
				Humanoid.WalkSpeed = Humanoid.WalkSpeed - (WalkspeedIncrement * 4)
			else
			    Humanoid.JumpPower = Humanoid.JumpPower - JumpPowerIncrement
				Humanoid.WalkSpeed = Humanoid.WalkSpeed - WalkspeedIncrement
			end
		end)
	end
	if CS:HasTag(v, "DamageObject") then
		local Debounce = false
		local Damage = v:FindFirstChild("Damage")
		local DebounceTime = v:FindFirstChild("Debounce")
		if Damage then
		v.Touched:Connect(function(Hit)
			local Player = game:GetService("Players"):GetPlayerFromCharacter(Hit.Parent)
			if not Player or Debounce then return end
			local Humanoid = Hit.Parent:FindFirstChild("Humanoid")
			if not Humanoid then return end
			if not Market:UserOwnsGamePassAsync(Player.UserId, Settings.Gamepass.InvincGamepassId) then
			Humanoid:TakeDamage(Damage.Value)
			end
			if DebounceTime then
				Debounce = true
				delay(DebounceTime.Value, function()
					Debounce = false
				end)
			end
		end)
	end
	end
	if CS:HasTag(v, "HealingPod") then
		local Pod = v.Parent
		local Bottom = v.Position - (v.Size / 2)
		local Top = v.Position + (v.Size / 2)
		local HealReg = Region3.new(Bottom, Top)
		local CooldownTime = v:FindFirstChild("Debounce")
		local HealthGain = v:FindFirstChild("HealthGain")
		if CooldownTime and HealthGain then
		RS.Heartbeat:Connect(function()
			local HealRange = workspace:FindPartsInRegion3(HealReg, Pod, 50)
			for i, v in pairs(HealRange) do
				local Character = v.Parent
				local Humanoid = Character:FindFirstChild("Humanoid")
				if Humanoid and not CS:HasTag(Character, "HealDebounce") then
					if Humanoid.Health + HealthGain.Value >= 100 then
						Humanoid:TakeDamage(-(100 - Humanoid.Health))
						else Humanoid:TakeDamage(-HealthGain.Value)
					end
					CS:AddTag(Character, "HealDebounce")
					delay(CooldownTime.Value, function()
						CS:RemoveTag(Character, "HealDebounce")
					end)
				end
			end
		end)
		end
	end
	if CS:HasTag(v, "ColorChanger") then
		local Players = game:GetService("Players")
		local Particles = v:FindFirstChild("Particles")--path for your particles here
		if not Particles then continue  end
		if not Particles.Value then continue end
		local cooldown = false
		local cooldowntimer = 15 -- Change this to whatever you want the cooldown to be
		local particletimer=2.1
		local refreshtimer=1.5
		local Color = v.Color
		v.Touched:Connect(function(partTouched)
			if not cooldown then
				Particles.Value.Enabled=true
				delay(particletimer,function() Particles.Value.Enabled=false end)
						delay(refreshtimer,function()
							local p = game:GetService("Players"):GetPlayerFromCharacter(partTouched.Parent)
							if p then
							cooldown = true
							local t = p.Character:GetDescendants()
							for i, v in pairs(t) do
								if v:IsA("MeshPart") or v:IsA("Part") or v:IsA("WedgePart") then
									if not v.Anchored then
										v.Color = Color
									end
								end
							end
							else
							if partTouched.Anchored then
								return
							end
											if partTouched.Parent:IsA("Model") then
									for i, v in pairs(partTouched.Parent:GetChildren()) do
										if v:IsA("BasePart") or v:IsA("MeshPart") then
											v.Color = Color
										end
									end
								end
							end
				end)
		        delay(cooldowntimer, function() cooldown = false end)
			end
		end)
	end
	if CS:HasTag(v, "NormalSize") then
		local c = v:FindFirstChild("ClickDetector")
		if not c then continue end
		c.MouseClick:Connect(function(p)
			if Other:InvokeClient(p, "IsSprinting") then
				Notify:FireClient(p, {Title = "Notification", Text = "Cannot shrink or grow while sprinting / boosting.", Duration = 5, Button1 = "Ok"})
				return
			end
			local ch = p.Character
			if not ch then return end
			local he = ch:FindFirstChild("Height")
			local h = ch:FindFirstChild("Humanoid")
			if not h or not he then return end
			for i, v in pairs(h:GetChildren()) do
				if v:IsA("NumberValue") then
					v.Value = 1
				end
			end
			h.WalkSpeed = 16
			h.JumpPower = 50
			he.Value = 0
		end)
	end
end
1 Like

Maybe you can do something like

local mps = game:GetService("MarketPlaceService") 
--Code if there is
if  mps:UserOwnsGamepassAsync(player.UserId, new gamepass number) then
--Code
elseif mps:UserOwnsGamepassAsync(plr.UserId, Old gamepass number) then
--Code
else
--Code if there is
end

You might want to disable the script your old scripter gave you and create a new one to test it out. So if there is problems, you can still enable the old script and use it

1 Like

the thing is, i cant script. thats why i hired him in the first place. this game is almost fully done so i dont want to hire a new scripter just for the end, thats why i ask this site for help mostly. i really dont want to erase the core script of the whole game at the end of development. i just want to have a new gamepass. could you maybe help me more?

I am very sorry, but we do not allow spoon-feeding. You have to learn how to properly change the script.

What I can tell you is this: a script running is in order (top to bottom. So if you have 47 lines in a script, it will go to 1, 2, 3,…). Use that to your advantage.

Maybe at this part you might want to change the GamepassMaxSize = 65 to 99999 and also change the gamepass Id

1 Like

what i always understood from that is that i cant ask to create scripts, but can ask to edit existing ones. i really dont have time to learn scripting properly (i am doing it slowly but surely but not good enough) i have always trusted this site in helping me alot if im without my scripter, its 1 to the last things ill ask to “spoonfeed” me because for my next game im hiring a new scripter

what that will do is also erase the old gamepass which i dont want.

There is no other way than hiring a new scripter. Please read the rules before posting a topic.

i know about it already. its just this site has helped me before when i didnt have a scripter, are there any places i can still ask for scripts you know about? i tried… i really did try to do this myself but i failed…

UI script

if game:GetService("MarketPlaceService"):UserOwnsGamepasseAsync(player.UserId, id) then
GamepassButton:Destroy()
end
1 Like

where should this go and what should i change about the script itself?

Make a new script and put it in screengui

and where do i put the new gamepass ID and max size and stuff?

you only need 5 lines of code

local player = game.Players.LocalPlayer
local mps = game:GetService("MarketPlaceService")
if mps:UserOwnsGamepassAsync(player.UserId, gamepassID)
gamepassButton:Destory()
end
1 Like

yes but doesnt the game need to know what gamepass it needs in order to ignore the other gamepass and what the new gamepass involves?

You put the gamepass ID that you want to put in

where do i put the gamepass id and max size info

Replace gamepassID with your gamepass

okay and so, which one? the one that should be ignored if you own a other gamepass or the one that should be owned to ignore

The one that you buy the gamepass it ignores others

1 Like