How do i Make dialog Style Like Hotline Miami?

I want to make npc dialog Style like Hotline Miami but the problem is i can’t script well.

2 Likes

I’m guessing you’re trying to make NPC dialogue? In this case, you’ll need to make a ScreenGui that has a Frame and a TextLabel inside the frame.

If you’re looking for a similar gradient effect, then you can use an UIGradient instance inside the TextLabel for the dialogue, and you can also add another TextLabel that has a ZIndex lower than the main TextLabel.

For the actual code, you can add a ProximityPrompt inside an invisible part that triggers a RemoteEvent; Create a RemoteEvent inside of ReplicatedStorage and do something like this:

-- Server
local DialogueRemote:RemoteEvent = game.ReplicatedStorage.DialogueRemote

local NPC_Part = script.Parent
local ProximityPrompt = NPC_Part:FindFirstChildOfClass("ProximityPrompt")

local DialogueText = "Hello stranger, what are you doing in my home?"

ProximityPrompt.Triggered:Connect(function(Player)
	DialogueRemote:FireClient(Player, DialogueText)
end)

-- Client

local DialogueRemote = game.ReplicatedStorage:WaitForChild("DialogueRemote")

local GUI = script.Parent
local Frame = GUI:WaitForChild("Frame")
local MainText, DropShadow = Frame:WaitForChild("MainText"), Frame:FindFirstChild("DropShadow", true)

local PopUpTime = 5 -- Amount of time it takes for the UI to disappear

DialogueRemote.OnClientEvent:Connect(function(DialogueText:string)
	if GUI.Enabled then return end -- Ensures the UI isn't already enabled to avoid spam
	
	GUI.Enabled = true
	MainText.Text = DialogueText; DropShadow.Text = MainText.Text
	wait(PopUpTime)
	GUI.Enabled = false
end)

This contains the code, UI, etc. Use it as a means to educate yourself in this stuff. Hope this helps!
Hotline Miami Dialogue UI.rbxl (57.5 KB)

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.