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

Why does the dialog gives tool and doesn't show dialog?

Asked by
yoshi8080 445 Moderation Voter
8 years ago

I was making a person who'd give gears, but it gives the gear when the character is equipping it. Also when the player has the tool in the backpack it won't show the certain dialog.

script.Parent.DialogChoiceSelected:connect(function(player, choice)
    if (choice == script.Parent.Choice1) then
    if (player.Backpack:FindFirstChild("Cola")==nil or player.Character:FindFirstChild("Cola")==nil) then
    local pistol = game.ServerStorage["Cola"]:clone()
            pistol.Parent = player.Backpack
            elseif (player.Backpack:FindFirstChild("Cola") or player.Character:FindFirstChild("Cola")) then 
                script.Parent.Choice1.ResponseDialog = "You already have a drink"
    end
    end
    if (choice == script.Parent.Choice2) then
    if (player.Backpack:FindFirstChild("Water")==nil or player.Character:FindFirstChild("Water")==nil) then
        local pistol2 = game.ServerStorage["Water"]:clone()
            pistol2.Parent = player.Backpack
        elseif (player.Backpack.FindFirstChild("Water") or player.Character:FindFirstChild("Water")) then
        script.Parent.Choice1.ResponseDialog = "You already have a drink"
    end
    end
    if (choice == script.Parent.Choice3) then
    if (player.Backpack:FindFirstChild("Juice")==nil or player.Character:FindFirstChild("Juice")==nil) then
        local pistol3 = game.ServerStorage["Juice"]:clone()
            pistol3.Parent = player.Backpack
    elseif (player.Backpack:FindFirstChild("Juice") or player.Character:FindFirstChild("Juice")) then
    script.Parent.Choice1.ResponseDialog = "You already have a drink"
    end
    end
end)
end)

Help?

0
One issue is that your checking if there character has the tool, in order for them to have it in there character, they would need to be holding the tool :/ pluginfactory 463 — 8y

Answer this question