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

I'm trying to make it so when my mouse hovers over a object my GUI appears it no work?

Asked by 4 years ago
Edited 4 years ago
 local UIS = game:GetService("UserInputService")
local pickupKey = "e"

local player = game.Players.LocalPlayer 
local mouse = player:GetMouse()

local PlayerGui = player:WaitForChild("PlayerGui")
local PickupInfoGui = PlayerGui:WaitForChild("PickupInfoGui")

UIS.InputChanged:Connect(function(input)
    if mouse.Target then
        if mouse.Target:FindFirstChild("Pickable") then
            local item = mouse.Target
            PickupInfoGui.Adornee = item
            PickupInfoGui.ObjectName.Text = item.Name
            PickupInfoGui.Enabled = true
        else
            PickupInfoGui.Adornee = nil
            PickupInfoGui.Enabled = false
        end
    end
end)

There is my code.

0
Please use edit your post and put your code in a "code block." To do so, click the Lua symbol while editing and paste your code between the lines. IStarConquestI 414 — 4y
0
ok kollin3456789 4 — 4y

Answer this question