Toggling Prompts?

I am trying to code UI but I have no clue on how to do this:

https://gyazo.com/15dfd5ebf47a6d65602642cc4998f6fd

Make a button and put this localscript in it:


local prompt = location — choose the prompt 
local mouse = game.Players.LocalPlayer:GetMouse()

script.Parent.MouseEnter:Connect(function()
wait(0.1)
prompt.Visible = true
while prompt.Visible == true do
prompt.Positon = UDim2.new(-50,mouse.X,50,mouse.Y)
end

script.Parent.MouseLeave:Connect(function()
prompt.Visible = false
end

that is actually interesting but that would not make any sense since I want it also moving positions maybe you can give one with positions?

1 Like

Is it supposed to move with your mouse or just appear in certain spots?

1 Like

yup move with mouse and its just like that

Look at this article :slight_smile:

script.Parent.TextButton.MouseEnter:connect(function()
    script.Parent.Info.Visible = true
end)
scritp.Parent.TextButton.MouseLeave:connect(function()
    script.Parent.Info.Visible = false
end)

So like something like this

@FerbZides I edited the post listen to what It says

1 Like

Ye your script is better. I’m a scripter noob XD

But the learning thing is helpful

Does the moving script work???

1 Like

I am actually trying to do something better but the 2 events you gave are actually the ones I am going to use

@FerbZides Are you just moving the position?

Can I get solution for “Toggling Prompts?”

local Hovering = false
script.Parent.HoverMe.MouseEnter:Connect(function()
	Hovering = true
end)
script.Parent.HoverMe.MouseLeave:Connect(function()
	Hovering = false
end)
local Mouse = game.Players.LocalPlayer:GetMouse()
Mouse.Move:Connect(function()
	if Hovering then
		script.Parent.Follower.Visible = true
		script.Parent.Follower.Position = UDim2.fromOffset(Mouse.X, Mouse.Y)
	else
		script.Parent.Follower.Visible = false
	end
end)

Hover.rbxl (25.1 KB)