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 3 years ago

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

1local player = game.Players.LocalPlayer
2local Block = script.Parent
3 
4Block.ClickDetector.MouseClick:Connect(function()
5    print("Success: Click has been detected!") --Testing that the function works.
6end)

1 answer

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

Try this:

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

1-- local player = game.Players.LocalPlayer This won't work in a normal script!
2local Block = script.Parent
3 
4Block.ClickDetector.MouseClick:Connect(function(player) -- the above non-functioning player line is substituted with this 
5    print("Success: Click has been detected by player[",player,"]!!") --Testing that the function works.
6end)

Hope this helps!

Ad

Answer this question