So the billboard gui should pop up when the npc is clicked but its not even detecting the click btw its in a local script
script.Parent.MouseClick:Connect(function(player)
print("detect")
script.Parent.Parent["Magic Dealer"].Head.BillboardGui.TextLabel.Visible = true
print("Visible")
local text = "What do you want?"
local function typewrite(object,text)
print("typewrite function")
for i = 1,#text,1 do
object.Text = string.sub(text,1,i)
wait(0.05)
end
end
typewrite(script.Parent.Parent["Magic Dealer"].Head.BillboardGui.TextLabel,text)
wait(1)
print("typewrite")
script.Parent.Parent["Magic Dealer"].Head.BillboardGui.TextLabel.Visible = false
end)

2 comments
LocalScript is not gonna run in workspace, you should use a normal script for that. In this case you can use player parameter passed to the function or remote event.
you need to use a serverscript