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

is there a way to keep tools if they are in player?

so basically i want to know if there is a way to keep your tools/guns if they are equipped and people still have the tools/guns when they die and repsawn

3 comments

0

You're asking if the user dies, they still have the tools that they died with?

0

Laser's response is perfectly valid. We won't create the script for you

0

@Shawnyg in which part does it say 'Make The Script For me' i am asking if there is a way to save a tool if it is euqipped because the script i made doesnt save the tool in character because it gets destroyed when the player dies

2 answers

Well u should try doing

1)Make Humanoid.Died function 2):GetChildren() from the backpack and players character 3)Get the tools and Put them in a model inside lighting 3)Use CharacterAdded and locate the model 4)Move tools inside backpack

2 comments

0

i tried that but the tools in the player character dont get saved because they just disappears when the player dies

0

That's why you put every tool inside the player's character into the backpack on death.

Make an ServerScript, put it inside 'StarterPack' & set the script to this:

--Made by ElmEditor to answer a question on ScriptingHelpers.org
local plr = script.Parent.Parent --Gets the player
local backpack = plr:FindFirstChild('Backpack') --Gets backpack
local starterpack = plr:FindFirstChild('StarterGear') --Gets StarterGear
--
if backpack and starterpack then --If starterpack + Startertools
backpack.ChildAdded:connect(function(item) --Childadded into backpack
	item:Clone().Parent = starterpack --Put into StarterGear
end) --Ends all our functions
end --Ends all our functions
end) --Ends all our functions
--Made by ElmEditor to answer a question on ScriptingHelpers.org

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