#Trying to make text hover when the mouse is pointing at a specific target
6 messages · Page 1 of 1 (latest)
-- Services
local Players = game:GetService("Players")
-- Player Vars
local Player = Players.LocalPlayer
-- UI Vars
local PlayerGUI = Player:WaitForChild("PlayerGui")
local Gameplay = PlayerGUI:WaitForChild("Gameplay")
local HoverUI = Gameplay:WaitForChild("HoverUI")
local Main = HoverUI:WaitForChild("Main")
local Class = Main:WaitForChild("Class")
local Habitable = Main:WaitForChild("Habitable")
local Subclass = Main:WaitForChild("Subclass")
-- Input Vars
local Mouse = Player:GetMouse()
-- Funcs
local function GetTarget()
if Mouse.Target then
if Mouse.Target.Name then
if Mouse.Target.Name == "Planet" then
local Planet = Mouse.Target
Main.Visible = true
Main.Position = UDim2.fromScale(Mouse.X, Mouse.Y)
elseif Mouse.Target.Name == "Ring" then
local Planet = Mouse.Target.Parent
Main.Visible = true
Main.Position = UDim2.fromScale(Mouse.X, Mouse.Y)
end
end
else
HoverUI.Visible = false
end
end
Mouse.Move:Connect(GetTarget)
Can you send your error logs?
no errors at all
Is anything happening?
** You are now Level 4! **