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?
01 | local sGui = script.ScreenGui |
02 | local frame = sGui.Frame |
03 | local player = game.Players.LocalPlayer |
04 | local mouse = player:GetMouse() |
05 | local pGui = script.Parent.Parent.PlayerGui |
06 |
07 | local function onButton 1 Down() |
08 | local targ = mouse.Target |
09 |
10 | --if part:FindFirstChild("examine")~= nil |
11 | --then |
12 | --sGui.Parent = pGui |
13 | -- frame.Visible=true |
14 | print ( "success" ) |
15 | --else |
01 | local sGui = script.ScreenGui |
02 | local frame = sGui.Frame |
03 | local player = game.Players.LocalPlayer |
04 | local mouse = player:GetMouse() |
05 | local pGui = script.Parent.Parent.PlayerGui |
06 |
07 | function onButton 1 Down() |
08 | local targ = mouse.Target |
09 |
10 | --if part:FindFirstChild("examine")~= nil |
11 | --then |
12 | --sGui.Parent = pGui |
13 | -- frame.Visible=true |
14 | print ( "success" ) |
15 | --else |
Here you go.