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

why doesn't this print anything in the console?

i'm trying to make a store dialog box which will upgrade car parts. i just want it to print "test" but it doesn't seem to work.

local dialogbubble = script.Parent
dialogbubble.DialogChoiceSelected:connect(function(player, choice)
    local stats = player:FindFirstChild("leaderstats")
    local Money = stats:FindFirstChild("Money")
if choice == script.Parent.Menu.Engine.option1 then
	print "test"
end

end)

3 comments

0

if you

0

if you're talking about the console in an actual server, have you check the server side?*

0

im talking about in roblox studio

1 answer

✓ Accepted answer

So. DialogChoiceSelected is a client feature. Create a RemoteEvent in ReplicatedStorage named "ChatEvent"

Local Script:

local dialogbubble = workspace.Part.Dialog

dialogbubble.DialogChoiceSelected:connect(function(plr,choice)
	game.ReplicatedStorage.ChatEvent:FireServer(choice)
end)

Server Script:

game.ReplicatedStorage.ChatEvent.OnServerEvent:Connect(function(plr,choice)
	if choice then
		local stats = plr:FindFirstChild("leaderstats")
		local Money = stats:FindFirstChild("Money")
		if choice == script.Parent.Menu.Engine.option1 then
			print "test"
		end
	end
end)

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