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

Text Box not popping up?

I know I've asked a lot of questions lately, sorry about that! But here's another problem, I am trying to make it so whenever you step on this brick, a dialog gui will pop up and so on. The output isn't giving me any errors, but it still won't work?

Help = game.ReplicatedFirst.HelperSamDialog

function onTouched(part)
	gui = Help:clone()
	gui.Parent = part.Parent
end

DialogStart = game.Workspace.HelperSamDialogStart
DialogStart.Touched:connect(onTouched)

1 comment

0

updated

1 answer

✓ Accepted answer

Nice try. A GUI would have to go INSIDE of a PlayerGui. I'll make a script and explain it for you:

local Help = game.ReplicatedFirst.HelperSamDialog -- I just heard local helps the engine read it faster, idk

game.Workspace.HelperSamDialogStart.Touched:connect(function(hit) -- An alternate way to combine both the function and connection line
	if game.Players:GetPlayerFromCharacter(hit.Parent) then -- checks if it is a player
		local p = game.Players:GetPlayerFromCharacter(hit.Parent) -- defines the player variable
		gui = Help:clone() -- clone it
		if p.PlayerGui:findFirstChild(gui.Name) then return end -- If they already havev the GUI, cancel
		gui.Parent = p.PlayerGui -- parent it to the playergui
	end -- close the if statement
end) -- close the connection and function

2 comments

0

Thank you so much! The only problem now is, every time I touch it it adds a new one. How could I fix this?

0

Thanks a million!

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