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

why doesn't this print anything in the console?

Asked by 4 years ago

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)
0
if you 0msh 333 — 4y
0
if you're talking about the console in an actual server, have you check the server side?* 0msh 333 — 4y
0
im talking about in roblox studio LemaFoxtrot 14 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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

Answer this question