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

How to put a weapon in a player's backpack?

Asked by 10 years ago

I would like a script that finds the weapon the player has chosen in a weapon GUI, and gives it to them after this happens...

StarterGui.ScreenGui.Map1.Visible = Map1
player = game.Players:GetChildren() 
target = Vector3.new(-8, 9.8, -3)
while true do
wait(30)
Map1 = true
wait(30)
Map1 = false

function fadeTo(a, b, c)
    for transparency = a, b, c do
    --go from a to b, counting by c

        for _, part in pairs(player.Character:GetChildren()) do
        --for each of the objects in the character,

            if part:IsA("BasePart") then
            --check if it's a part, and if so

                part.Transparency = transparency
                --set its transparency
            end
        end
        wait(0.1)
    end
end

fadeTo(0, 1, 0.1) --fade out,
player.Character.Torso.CFrame = target --teleport the player
fadeTo(1, 0, -0.1) --fade back in
end

While you're at it, does what I have so far look right?

0
Could you atleast show what's in the gui and also what do you mean by selected then I can answer your question. HexC3D 830 — 10y
0
Forget the GUI. I just need to be able to put the object, in this case a sword, in the player's backpack after they are teleported into the map. Antharaziia 75 — 10y

Answer this question