Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Dialog doesnt appear when Clicked on Add Dialog?

I wanted to make a gui where people can add dialogs to their own characters however it never shows up :( here is my code:

local ply = game.Players.LocalPlayer.Humanoid.Head
local txt = script.Parent.Parent.TextBox.Text

function onClick()
	local dia = Instance.new("Dialog")
	dia.Parent = ply
	dia.InitialPrompt = txt
end

1 comment

0

Yes i forgot to add the Mouseclickbutton1:connect thing sorry

1 answer

✓ Accepted answer

###The Head is not inside of the Humanoid, but inside of the Character.

local ply = game.Players.LocalPlayer
local button -- location of button here
local txt = script.Parent.Parent.TextBox

local function onClick() -- use more local variables unless you need it global
    local dia = Instance.new("Dialog")
    dia.InitialPrompt = txt.Text
    dia.Parent = ply.Character.Head -- it's in character not humanoid
end

button.Activated:Connect(onClick)

1 comment

0

thank you so much

This discussion is preserved as it was. New answers, comments, and votes are closed.