Im trying to make a script that if you click a block with the name "Touch" A gui pops up, This is what i have so far but its only if i click one block not any
game.Workspace:FindFirstChild(script.Parent.Value.Value).Click.ClickDetector.MouseClick:connect(function() game.Players.LocalPlayer.PlayerGui.Buy.Visible = true end)
Use a local script located in someplace like ReplicatedFirst, and use the mouse property of the player.
-- Local Script in ReplicatedFirst local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() local gui = plr:WaitForChild("PlayerGui"):WaitForChild("Buy") -- buy should be one of those ScreenGuis or whatever, I assume mouse.Button1Down:Connect(function() local target = mouse.Target if(target.Name=="NAME HERE")then gui.Enabled = true -- if screenGui I think the property is Enabled, else make sure the GUI is in a ScreenGui or it won't be displayed. end end)