Hello,
I want to make so if the mouse target a brick a gui will be visible but its not working
This is the script i using now;
local player = game.Players.Localplayer Mouse = player:GetMouse() if Mouse.Target == "Part" then player.PlayerGui.ScreenGui.Frame.Visible = true end
That is wrong in a couple ways.
Mouse.Target
is an object, so you should be looking for workspace.Part
instead of "Part"
Your script will only update once, and that's when the script first loads. You want to add in a part where the script will constantly update whenever the mouse is moved. Like so:
local player = game.Players.Localplayer Mouse = player:GetMouse() Mouse.Move:Connect(function() if Mouse.Target == workspace.Part then player.PlayerGui.ScreenGui.Frame.Visible = true end end)