DoubleJump Gamepass

I’m Trying To Clone A DoubleJump Script To Player Backpack After Server Finds Out If They Bought A Gamepass

local ServerStorage = game:GetService("ServerStorage")
local player = game:GetService("Players")
local DoubleJump = script.DoubleJump
local DJEvent = game.ReplicatedStorage.Events.DJ

DJEvent.OnServerEvent:Connect(function(plr)
	local GamepassBools = plr:WaitForChild("GamepassBools")
	local DoubleJump = GamepassBools:WaitForChild("DoubleJump")
	local Backpack = plr:WaitForChild("Backpack")

		if DoubleJump.Value == true then
		DoubleJump:Clone().Parent = Backpack
	else

	end
end)
2 Likes

Maybe this will work?

local ServerStorage = game:GetService("ServerStorage")
local player = game:GetService("Players")
local DoubleJump = script.DoubleJump
local DJEvent = game.ReplicatedStorage.Events.DJ

DJEvent.OnServerEvent:Connect(function(plr)
	local GamepassBools = plr:WaitForChild("GamepassBools")
	local DoubleJumpBool = GamepassBools:WaitForChild("DoubleJump")
	local Backpack = plr.Backpack

	if DoubleJumpBool.Value == true then
		DoubleJump:Clone().Parent = Backpack
	end
end)

if you wanna find out if player bought gamepass then try doing something like this:

        local Marketplace = game:GetService("MarketplaceService")
        local Rep = game:GetService("ReplicatedStorage") --Get ReplicatedStorage
        local Sword = Rep:WaitForChild("FidgetSpinner") -- Get the Tool/Sword


         local gamepassID = 17420601-- Gamepas Id here

    Marketplace.PromptGamePassPurchaseFinished:Connect(function(player, purchasePassID, purchaseSucces, Char)

    	if purchaseSucces == true and purchasePassID == gamepassID then -- if player has purchased give him the sword
    		print(player.Name.."purchased the sword pass")
    		Sword.Parent = player.Character
    	end

end)