Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a Part go in the Players backpack? [closed]

Asked by 6 years ago

I want to know how to make a part go in the players backpack so the game could be complete.

0
put the parts parent in the backpack if u want it in there hiimgoodpack 2009 — 6y

Closed as Not Constructive by PyccknnXakep, Void_Frost, 2eggnog, and Thetacah

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 6 years ago

Very simple, just parent the part into the back pack

--FOR USE IN LOCAL SCRIPT
 Part = game.workspace.Part

Part.Parent = game.Players.LocalPlayer.Backpack

--FOR USE IN NORMAL SCRIPT

Player = game.Players.SpyGuyTBM
Part = game.workspace.Part

Part.Parent = Player.Backpack
Ad
Log in to vote
0
Answered by 6 years ago

This is how u do it in one line :P

game.workspace.Part.Parent = game.Players.LocalPlayer.BackPack

That may not work ^ but it is still one line :D XD

This will work I guarantee you

local part = -- your part
local player = game:GetService("Players").LocalPlayer
local backpack = player:FindFirstChild("BackPack")
if player then
    if part then
        if backpack then
            part.Parent = backpack
        end
    else
        print("Dude, alter the variable called "Part" and then try again")
    end
else
    print("I should probably load first")
end

Their is no way that shouldn't work ^^^^^^^