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

How Would I MakeIt Specific like a certain item?

for i, v in pairs(game.Lighting:GetChildren()) do v.Parent = game.Players.LocalPlayer.Backpack end

2 comments

0

Code block

0

What do you mean?

1 answer

If you're trying to get a specific item, here's some example code:

local ToolName = "Sword" -- Change this to your tool name

local FindTool = game:GetService("Lighting"):FindFirstChild(TooName)
if FindTool then -- If we find a child named "Sword" in Lighting
FindTool.Parent = game.Players.LocalPlayer.Backpack -- changes the parent to the Player's backpack, but I suggest using remoteevents
end

This code will check if there's a child named ToolName, "Sword", in game.Lighting. If there is, it will change the child's parent to the LocalPlayer's backpack. Else, the script will return/end.

Hope this helps!

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