Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Can I make a ScreenGui appear when the mouse is hovering over a part?

Asked by 7 years ago

I already know about the '.MouseHoverEnter" stuff but I am lost on how to make a Gui appear. Do I need a local script?

0
Just make a GUI and put it in the Lighting and create a part and insert click detector and script in it and write a script showing that when a player hovers the mouse over the part it creates a clone of that gui from lighting and place it in playerGUI. theepicspider1 15 — 7y

3 answers

Log in to vote
0
Answered by 7 years ago

You could place SurfaceGui's around the part, and when it's hovered, find the closest player.

Ad
Log in to vote
0
Answered by 7 years ago

You can keep the screengui in playergui if you want. The "Player" parameter tells you which player clicked it. We can then go to the Players gui by finding the players name. (I'm not sure if you can just do "Player.PlayerGui", you can try it out.

You will need to change the script depending on the screengui name and stuff

script.Parent.ClickDetector.MouseHoverEnter:connect(function(Player)
    game.Players:FindFirstChild(Player.Name).PlayerGui.ScreenGui.Frame.Visible = true
end)

script.Parent.ClickDetector.MouseHoverLeave:connect(function(Player)
    game.Players:FindFirstChild(Player.Name).PlayerGui.ScreenGui.Frame.Visible = false
end)

Log in to vote
-1
Answered by 7 years ago

Just make a GUI and put it in the Lighting and create a part and insert click detector and script in it and write a script showing that when a player hovers the mouse over the part it creates a clone of that gui from lighting and place it in playerGUI.

script.Parent.ClickDetector.MouseHoverEnter:connect(function()
    game.Lighting.ScreenGui:clone().Parent=game.Players.LocalPlayer.PlayerGui
end)

script.Parent.ClickDetector.MouseHoverLeave:connect(function()
    game.Players.LocalPlayer.PlayerGui.ScreenGui:Destroy()
end)
0
You can't use LocalPlayer in a regular script in any real server setting, and you can have Local Scripts in workspace. OldPalHappy 1477 — 7y

Answer this question