Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

anyone know how to give a player a tool after choosing a dialogue choice from an NPC?

Asked by 4 years ago

I want the player to receive a tool after selecting a dialogue choice from an NPC.

0
This is not a script request site. Try it firstly by yourself. GodOf_Lua 25 — 4y
0
i did. I am a builder so i am pretty bad pinelemongamer 19 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You could use DialogChoiceSelected, just make a script in the Dialog and add the following.

script.Parent.DialogChoiceSelected:connect(function(player, choice)
    if (choice == script.Parent.Choice1) then -- Change the Choice1 to whatever your choice's name is.
        local item = game.ServerStorage:FindFirstChild("itemname"):clone() -- Change itemname to the name of the item.
        item.Parent = player.Backpack
    end
end)

Do note that I made that the item must be in the ServerStorage in order to get found. You can change the item's location but i suggest you leave it at the ServerStorage.

0
tysm pinelemongamer 19 — 4y
Ad

Answer this question