Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)
	


2 comments

0

Try using choice.Name == "choice1", roblox has been having some bugs with comparing instances.

0

Doesnt work..

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.