Help with a script

  1. I commissioned a Modeler, @Red1Monster, his job was amazing! Now, I want to receive the food in my inventory when I click on the model.

  2. Pratically, using my script, I need a tool which is located in ServerStorage for it to work.

  3. I haven’t a tool, but I only have the mesh part, and I don’t know how to solve this. Below you can find my code:


Item:Clone().Parent = Plr.Backpack


You must have a ClickDetector.

1 Like

I have, inside the clickdetector I put the script.

Add a script inside the Part and type this in it:

local Part = script.Parent.GivePart
local CD = script.Parent.ClickDetector
local Tool = --Tool location here.

	local ClonedTool = Tool:Clone()
	ClonedTool.Parent = PlayerWhoClicked.Backpack

EDIT: Remove the script from the ClickDetector and add the Script to the Part that the Player must Click it to get the Tool.

1 Like

That has to be in a ServerScript, otherwise the script cannot view the content of ServerStorage.

So, to make it simple the player will get the specified tool when the clickDetector is triggered.

Firstly, you need without exception a tool, you can directly build one in your script.

local SStorage = game:GetService("ServerStorage")
local displayedMesh = script.Parent.Parent -- the name of that mesh will be used to index the tool in SStorage
local clickDetector = script.Parent

       local requestedTool = SStorage:FindFirstChild(displayedMesh.Name)

      if requestedTool then
            local tool ="Tool")

            local meshClone = displayedMesh:Clone()

            mesh.Parent = tool
            mesh.Anchored = false
            mesh.Name = "Handle"

            tool.Parent = plr.Backpack
            warn("Couldn't find the tool)
1 Like

I made extremely simple script.


game.ServerStorage.Tool:Clone().Parent = plr.Backpack


I have tried this and it worked!

Greetings @SubbIezHolder, sorry for that! I just fixed the full script and tested it:

local Part = script.Parent
local CD = Part.ClickDetector
local Tool = game.ServerStorage -- Put yoru tool's Location here

	local ClonedTool = Tool:Clone()
	ClonedTool.Parent = PlayerWhoClicked.Backpack

Thank you,

EDIT: Remember to put the script in the Part that you want the Player to click to get the tool.

I do not have a tool in serverstorage! I have only the mesh part.

You must have a Tool, because when the player click the Part they can’t get a MeshPart.
You can’t make the Player get a MeshPart.

  1. Clone your mesh part.
  2. Make a Tool.
  3. Name the mesh part’s clone Handle and put it in the Tool.
  4. Name the Tool.
  5. Put the Tool in ServerStorge.

Yes, but idk how to make a tool.

It’s not working…[30]…

Click on the white button next to “StarterPack” and click on tool.
Then get your mesh and name it Handle. Make sure the mesh is parented in your tool.
You should Install the Tool Grip Editor Plugin to adjust the position of your handle.