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

Simple: Need to give tools based on the Equipped Character?

Asked by 2 years ago
game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
        local player = script.Parent
        local Char = player.EquippedCharacter.Value
        local Tool = script.Blaster 

        if Char == "Lucas" then
            local ToolClone = Tool:Clone()
            ToolClone.Parent = Player.Backpack
        end
    end)
end)

--Needs to constantly check if I changed my character which is stored as a value in the player named EquippedCharacter and want it to duplicate tools into backpack if that character is selected

1 answer

Log in to vote
0
Answered by
lamgogo 56
2 years ago
Edited by Xapelize 2 years ago

i recommend u to check the player's character name, cuz i didnt see any errors here

an example for this:

game.Players.PlayerAdded:Connect(function(Plr)
    Player.CharacterAdded:Connect(function(Char)
        local Tool = script.Blaster 

        if Char.Name == "Lucas" then
            local ToolClone = Tool:Clone()
            ToolClone.Parent = Player.Backpack
        end
    end)
end)

and yeah,u need to make the character name "Lucas"

Ad

Answer this question