Would anyone know how to script receiving a badge by clicking a certain option using this system? How to hold a conversation with an NPC using Beastslash's Dialogue Maker
I already know how to script a badge using the normal dialog system that comes with roblox studio but was wondering if it was possible to script a badge using that system. Thanks in advance.
1 Like
You can use After Actions.
1 Like
Yeah, I had attempted to use those but I had no idea what I was doing. For reference, what I was doing for the normal Roblox dialogue is creating a local script like so:
local dialog = workspace.NPCS.nob.Head.Dialog
local plr = game:GetService("Players").LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local function onSelected(player, choice)
if choice == dialog.DialogChoice.Helper1.Helper2.Helper3.Helper then
wait(2)
game.ReplicatedStorage.BadgeGet2:FireServer()
end
end
dialog.DialogChoiceSelected:Connect(onSelected)
Then finish the remote event with a server script:
game.ReplicatedStorage.BadgeGet2.OnServerEvent:Connect(function(player)
game:GetService("BadgeService"):AwardBadge(player.UserId,2142617446)
game.ReplicatedStorage.SendChatEvent8:FireAllClients(player.Name.. " lent a helping hand.")
end)
I am unsure how to replicate that in the after action. I tried pasting the remote event in the actions thing but it didn’t seem to work.