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

I have error in the scripting that I don't understand, how do I fix it?

Not sure why I am getting an error: https://gyazo.com/c1925a7b582ba651bc7f5b8e30da3739

script.Parent.DialogChoiceSelected:connect(function(player, choice)
	if choice == script.Parent.DialogChoice.Burger.Okay then
			game.ReplicatedStorage.Burger:Clone().Parent = player.Backpack
			game.ReplicatedStorage.Burger:Clone().Parent = player.StarterGear
		end
	if choice == script.Parent.DialogChoice.BloxyCola.Okay then
			game.ReplicatedStorage.BloxyCola:Clone().Parent = player.Backpack
			game.ReplicatedStorage.BloxyCola:Clone().Parent = player.StarterGear
		end
if choice == script.Parent.DialogChoice.Pizza.Okay then
			game.ReplicatedStorage.Pizza:Clone().Parent = player.Backpack
			game.ReplicatedStorage.Pizza:Clone().Parent = player.StarterGear
		end

1 comment

0

put " end) " (including the close bracket) at the end to close the function.

1 answer

✓ Accepted answer
script.Parent.DialogChoiceSelected:connect(function(player, choice)
    if choice == script.Parent.DialogChoice.Burger.Okay then
            game.ReplicatedStorage.Burger:Clone().Parent = player.Backpack
            game.ReplicatedStorage.Burger:Clone().Parent = player.StarterGear
        end
    if choice == script.Parent.DialogChoice.BloxyCola.Okay then
            game.ReplicatedStorage.BloxyCola:Clone().Parent = player.Backpack
            game.ReplicatedStorage.BloxyCola:Clone().Parent = player.StarterGear
        end
if choice == script.Parent.DialogChoice.Pizza.Okay then
            game.ReplicatedStorage.Pizza:Clone().Parent = player.Backpack
            game.ReplicatedStorage.Pizza:Clone().Parent = player.StarterGear
   	end
end)

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