script.Parent.MouseClick:connect(function()
print"click"
end)
This is literally just a script in a block and it doesn't print, my game is FE but i don't know if that's the problem. Please help.
script.Parent.MouseClick:connect(function()
print"click"
end)
This is literally just a script in a block and it doesn't print, my game is FE but i don't know if that's the problem. Please help.
Insert a Local script into the StarterGui
Inside local script :
local part = game.Workspace.Part
local cd =part.ClickDetector
Insert a Remote event in replicated storage name it ClickEvent
local ce=game:GetService ('ReplicatedStorage'):WaitForChild ('ClickEvent')
cd.MouseClick:connect(function()
ce:FireServer()
end)
Inside the script in the part put this:
local ce = game:GetService('ReplicatedStorage'):WaitForChild('ClickEvent')
ce.OnServerEvent:connect(function()
print('clicked')
end)
jt is... inside the part dude
Where is the script located?
Edited my answer hope it works now.
function OnClicked()
--put whatever the function does here
print("click")
end
script.Parent.ClickDetector.MouseClick:connect(OnClicked)
Hope this helps.
Note: Put wherever the part is where "script.Parent" is. I'm assuming the script is in the part.
still doesnt work D:
Do you have filtering enabled on?
Yeah
This discussion is preserved as it was. New answers, comments, and votes are closed.
8 comments
Is there a click detector inside the part?
yeah
Can you post the entire script?
that is the entire script
Is the entire function just to print "click" ?
pretty much
My answer should fix it since your game has fe on.
Consider this, https://scriptinghelpers.org/questions/30209/using-getmouse-instead-of-clickdetector