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

I start with a sword in game, when I die, I lose my sword forever? [closed]

Asked by
ABlLITY 10
8 years ago

I start with a sword in game, when I die, I lose my sword forever? Message me if you need more details.

Closed as Not Constructive by Sublimus and BlackJPI

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?

1 answer

Log in to vote
0
Answered by 8 years ago
player = game.Players.LocalPlayer
weapon = player.Backpack.Weapon --or wherever your weapon is located

player.CharacterAdded:connect(function(character)
    local hum = character:FindFirstChild("Humanoid")
        hum.Died:connect(function()
            local newWeapon = weapon:Clone()
            wait(5)
            newWeapon.Parent = player.Backpack
        end)
end)
Ad