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

Advanced Dialog Tool Giver?

Asked by 7 years ago

I'm trying to give a weapon to a player after they've chosen a specific dialog. I know only a little scripting so it just may be me. I don't know what is wrong with my script. I've tried many alternatives like switching the position of the script (while changing the script too by ading a parent) but nothing seems to work for me, even tutorials on youtube and google.

Script:

script.Parent.DialogChoiceSelected:connect(function(player, choice)
    if (choice == script.Parent.Choice2) then -- the dialog selects Choice2?
            pistol = game.Lighting["M1911"]:clone()
            pistol.Parent = player.Backpack -- the dialog clones and loads the M1911 into the player's backpack from the lighting?

    end
end)

Explorer:

Dialog
    DialogChoice
        Script
        Choice1
        Choice2

Lighting:

Lighting
    (other random stuff)
    (other random stuff)
    (other random stuff)
    M1911

1 answer

Log in to vote
0
Answered by 7 years ago

you could try an if an then command for example if choice 1 then the item would be duplicated from the lighting and brought to the players backpack

Ad

Answer this question