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

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

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

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"

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