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

Why doesn't the player receive putter after asking the BOT for one?

Asked by 6 years ago
Edited 6 years ago

I'm making a golf course with my friend and we want the bots to give the players a golf club. However, after finishing the conversation, players do not receive the club

script.Parent.DialogChoiceSelected:connect(function(player, choice)
    if (choice == script.Parent.choice1) then
    if (player.Backpack:findFirstChild("Putter")==nil) then
            putter = game.Lighting.Putter:clone()
            putter.Parent = player.Backpack
    end
    end
end)



0
Try using choice.Name == "choice1", roblox has been having some bugs with comparing instances. Bellyrium 310 — 6y
0
Doesnt work.. iSidersz 70 — 6y

1 answer

Log in to vote
0
Answered by
Corexty 15
6 years ago

This should fix it ;)

script.Parent.DialogChoiceSelected:connect(function(player,choice)
    if choice==script.Parent.choice1 then
        if player.Backpack:FindFirstChild("Putter") then
        else
            local putter=game.Lighting.Putter:Clone()
            putter.Parent=player:WaitForChild("Backpack")
        end
    end
end)
Ad

Answer this question