I tried what my friend said about how I can add the Model ID number in the script to make it as a tool. What I want it to do is make the NPC give you tools, but from the model you create. Can you please fix it, or at give me something that is similar that can actually works.
function clicked(player, dialogChoice) print("Talked") print(player) print(dialogChoice) if dialogChoice.Name == "Ticket" then print("Player gives Ticket") g = game:GetService("InsertService"):LoadAsset(213984396) --Model ID number g.Parent = player.Backpack g:MakeJoints() -- Capitalize just incase. g:MoveTo(player.Character:WaitForChild("Head").Position) else print(dialogChoice) end end script.Parent.DialogChoiceSelected:connect(clicked)
Instead of using the InsertService, you could just parent the tool under ReplicatedStorage, and then clone it to the Player.
script.Parent.DialogChoiceSelected:connect(function(player, dialogChoice) print("Talked") print player print dialogChoice if dialogChoice.Name == "Ticket" then print("Player gives Ticket") g = game.ReplicatedStorage:FindFirstChild("MODEL") -- Replace MODEL with the name of your model in ReplicatedStorage g:Clone().Parent = player.Backpack else print("Failed") end end)
You shouldn't be asking for code in this website. Instead, you should post the code and try to tell the community what error(s) you see or get.