Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how would i fix this error in my gamepass giver script(error in question)?

20:59:54.585 - The Parent property of GravityCoil is locked, current parent: NULL, new parent Backpack

local gamepassid_ = 10022825
local b = game:GetService("ServerStorage"):FindFirstChild("GravityCoil"):Clone()
game.Players.PlayerAdded:Connect(function(player)
    if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 10022825) then
        if player.Backpack:FindFirstChild("GravityCoil") == nil then
            game.ServerStorage:FindFirstChild("GravityCoil"):Clone()
            b.Parent = player.Backpack 
        end
    end
end)


    game:GetService('Players').PlayerAdded:Connect(function(player)
    	player.CharacterAdded:Connect(function(character)
    		character:WaitForChild("Humanoid").Died:Connect(function()
	wait(5.5)
	print(gamepassid_)
    if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 10022825) then
        if player.Backpack:FindFirstChild("GravityCoil") == nil then
            game.ServerStorage:FindFirstChild("GravityCoil"):Clone()
            b.Parent = player.Backpack 
        end
    end
end)

    		end)
    	end)

im taking a bath so i hope theres an awnswer to this when im back

1 comment

0

bruh dont show ur id gamepass

1 answer

fixed it myabe lol brrr

local gamepassid_ = 10022825
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
	    if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 10022825) then
	        if not player.Backpack:FindFirstChild("GravityCoil") then
	            local b = game:GetService("ServerStorage"):FindFirstChild("GravityCoil"):Clone()
	            b.Parent = player.Backpack 
	        end
	    end
		if character:FindFirstChild("Humanoid").Died then
			wait(3)
			if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 10022825) then
	      	 	if not player.Backpack:FindFirstChild("GravityCoil") then
	          		local b = game:GetService("ServerStorage"):FindFirstChild("GravityCoil"):Clone()
	          	  	b.Parent = player.Backpack 
	        	end
	  	  	end
		end
	end)
end)

1 comment

0

i already fixed it sadly theres another error though although its not a error as much as a bug in the game

This discussion is preserved as it was. New answers, comments, and votes are closed.