The mainscript (ServerScriptService):
local createDialogueEvent = game.ReplicatedStorage.Remotes.createDialogueEvent
local hideDialogueEvent = game.ReplicatedStorage.Remotes.hideDialogueEvent
local setDialogueImageEvent = game.ReplicatedStorage.Remotes.setDialogueImageEvent
local BadgeID = 2124846067
local BadgeService = game:GetService("BadgeService")
local proximityPrompt = workspace.Tutorial.UpperTorso.TutorialPrompt
proximityPrompt.Triggered:Connect(function(playerWhoActivated)
setDialogueImageEvent:FireAllClients("Tutorial", Color3.new(255, 255, 0))
createDialogueEvent:FireAllClients("")
task.wait(0.5)
createDialogueEvent:FireAllClients("Hello, welcome to Outfit Tester!")
task.wait(2.5)
createDialogueEvent:FireAllClients("I'll give you a little tutorial on how to use this game.")
task.wait(4)
createDialogueEvent:FireAllClients("First of all, this game is used for testing catalog items on your avatar without having to buy them...")
task.wait(6.5)
createDialogueEvent:FireAllClients("This is done via commands.")
task.wait(2.5)
createDialogueEvent:FireAllClients("'But how do you use the commands?' I can see you asking...")
task.wait(3.5)
createDialogueEvent:FireAllClients("You can see all the commands you can use by typing ':commands'")
task.wait(4.5)
createDialogueEvent:FireAllClients("If you've bought any of the gamepasses, their commands will show up here too!")
task.wait(5)
createDialogueEvent:FireAllClients("Commands for equipping items (like :shirt) on your avatar require you to use an item ID...")
task.wait(5)
createDialogueEvent:FireAllClients("To find your item ID, just go to the item you want in-game on the Roblox website and copy the line of numbers in the link on top of the page.")
task.wait(9)
createDialogueEvent:FireAllClients("The chat format for commands is: ':command me your-ID'")
task.wait(5)
createDialogueEvent:FireAllClients("You won't need to use an ID for commands that don't give you any items!")
task.wait(5)
createDialogueEvent:FireAllClients("Those are pretty much the basic things you need to know about this game!")
task.wait(5)
hideDialogueEvent:FireAllClients()
BadgeService:AwardBadge(playerWhoActivated.UserId, BadgeID)
end)
The other script (StarterGUI):
local StarterGui = game:GetService("StarterGui")
local createDialogueEvent = game.ReplicatedStorage.Remotes.createDialogueEvent
local hideDialogueEvent = game.ReplicatedStorage.Remotes.hideDialogueEvent
local setDialogueImageEvent = game.ReplicatedStorage.Remotes.setDialogueImageEvent
local richText = require(game.ReplicatedStorage.Modules.RichText)
local player = game.Players.LocalPlayer
local dialogueFrame = player.PlayerGui.MainGui.DialogueFrame
local function swooshSound()
local sound = Instance.new("Sound",game.ReplicatedStorage)
sound.PlaybackSpeed = 1
sound.Volume = 0.5
sound.PlayOnRemove = false
sound.SoundId = "rbxassetid://4845387138"
sound:Destroy()
end
hideDialogueEvent.OnClientEvent:Connect(function()
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
swooshSound()
dialogueFrame:TweenPosition(UDim2.new(0.5,0,2,0),.1)
end)
createDialogueEvent.OnClientEvent:Connect(function(english,spanish)
if dialogueFrame.Position ~= UDim2.new(0.5,0,0.85,0) then
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
dialogueFrame:TweenPosition(UDim2.new(0.5,0,0.85,0),.1)
end
local ln = game:GetService("LocalizationService").RobloxLocaleId
local content = english
if ln == "en-us" then
content = english
elseif ln == "es-es" then
if spanish then
content = spanish
end
end
local textObject = richText:New(dialogueFrame.textFrame, content)
textObject:Animate(true)
end)
-- Viewport Script Starts Here
local function cleanVPF()
if dialogueFrame.ViewportFrame:FindFirstChildOfClass("Model") then
dialogueFrame.ViewportFrame:FindFirstChildOfClass("Model"):Destroy()
end
if dialogueFrame.ViewportFrame:FindFirstChildOfClass("Camera") then
dialogueFrame.ViewportFrame:FindFirstChildOfClass("Camera"):Destroy()
end
end
setDialogueImageEvent.OnClientEvent:Connect(function(charName,color)
dialogueFrame.nameLabel.TextColor3 = color
dialogueFrame.nameLabel.Text = charName
local vpCharacter = game.Workspace:FindFirstChild(charName)
if vpCharacter then
cleanVPF()
local obj = vpCharacter:Clone()
obj.Parent = dialogueFrame.ViewportFrame
local cam = Instance.new("Camera")
cam.Parent = dialogueFrame.ViewportFrame
cam.CFrame = CFrame.new(obj.Head.Position + (obj.PrimaryPart.CFrame.lookVector*2), obj.Head.Position)
dialogueFrame.ViewportFrame.CurrentCamera = cam
else
warn(charName .. " is not in ReplicatedStorage")
end
end)