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)
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)