Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

No response from the output on testing. Easy fix?

Asked by 2 years ago

Trying to get a print that this pretty simple line of code is functional, no response from the output.

local player = game.Players.LocalPlayer
local Block = script.Parent

Block.ClickDetector.MouseClick:Connect(function()
    print("Success: Click has been detected!") --Testing that the function works.
end)

1 answer

Log in to vote
0
Answered by
TGazza 1336 Moderation Voter
2 years ago

Try this:

Must be a Normal (Not Local) Script!!!

-- local player = game.Players.LocalPlayer This won't work in a normal script!
local Block = script.Parent

Block.ClickDetector.MouseClick:Connect(function(player) -- the above non-functioning player line is substituted with this  
    print("Success: Click has been detected by player[",player,"]!!") --Testing that the function works.
end)

Hope this helps!

Ad

Answer this question