Information:
- I am not getting any errors
- I already attempted this, it didn't work.
- The parent of the script StarterCharacter.StarterPlayerScripts
- The script is a LocalScript
- The part is in Workspace.
- The BoolValue is in the part.
- There are multiple parts.
Attempt:
local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
game.Players.PlayerAdded:Connect(function(player)
UIS.InputChanged:Connect(function(input)
if mouse.Target then
if mouse.Target:FindFirstChild("BoolValue") then
player.PlayerGui.CollectGUI.Enabled = true --ScreenGUI is enabled
player.PlayerGui.CollectGUI.Frame.Position = UDim2.new(0, mouse.X, 0, mouse.Y) --Frame follows mouse
player.PlayerGui.CollectGUI.Frame.ItemName.Text = mouse.Target.Parent.Name -- ItemName.Text is the part's name
else
player.PlayerGui.CollectGUI.Enabled = false --ScreenGUI is disabled
player.PlayerGui.CollectGUI.Frame.Position = UDim2.new(0, 0, 0, 0) --Frame position is reset
player.PlayerGui.CollectGUI.Frame.ItemName.Text = "" --ItemName.Text is reset
end
end
end)
end)

2 comments
Hello! I am here to inform you that in this case, RunService.Stepped is more useful then RunService.RenderStepped
Thanks for the info, I don't really know the difference. I appreciate you telling me that.