What is wrong with this onButton1Down() function? Its supposed to fire when anything in the game is clicked on but it doesn't. What am i doing wrong?
local sGui=script.ScreenGui local frame=sGui.Frame local player=game.Players.LocalPlayer local mouse=player:GetMouse() local pGui = script.Parent.Parent.PlayerGui local function onButton1Down() local targ=mouse.Target --if part:FindFirstChild("examine")~= nil --then --sGui.Parent = pGui -- frame.Visible=true print("success") --else -- print("fail") --end end mouse.Button1Down:Connect(onButton1Down)
local sGui=script.ScreenGui local frame=sGui.Frame local player=game.Players.LocalPlayer local mouse=player:GetMouse() local pGui = script.Parent.Parent.PlayerGui function onButton1Down() local targ=mouse.Target --if part:FindFirstChild("examine")~= nil --then --sGui.Parent = pGui -- frame.Visible=true print("success") --else -- print("fail") --end end mouse.Button1Down:Connect(onButton1Down)
Here you go.