0 views0 copies0 likes
NPC Dialogue Panel from Interaction Prompts
Universal script
Copy it, then test it in your own Studio place.
Script code
17 lines ยท 0.7 KBlocal player = game:GetService("Players").LocalPlayerlocal prompts = game:GetService("ProximityPromptService")local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))gui.ResetOnSpawn = falselocal panel = Instance.new("TextButton", gui)panel.AnchorPoint = Vector2.new(0.5, 1)panel.Position = UDim2.fromScale(0.5, 0.88)panel.Size = UDim2.new(0.82, 0, 0, 105)panel.TextWrapped, panel.Visible = true, falsepanel.TextSize = 20panel.Activated:Connect(function() panel.Visible = false end)prompts.PromptTriggered:Connect(function(prompt, who) local text = prompt:GetAttribute("DialogueText") if who ~= player or typeof(text) ~= "string" then return end-- โฆopen Get script for the full sourceAbout this script
Place a ProximityPrompt on your shopkeeper and add a string attribute named DialogueText to that prompt. This LocalScript shows a small, dismissible dialogue panel on the player's screen whenever they activate a prompt with that attribute. You can reuse the same panel for any number of NPCs. Keep each message short enough for phone screens and test that unrelated prompts remain silent.
Log in to leave a comment.
No comments yet
Be the first to share your thoughts!
Comments
Share what works, ask questions, or report an issue.