I want it to detect if the player clicks on the pantry outside the UI
So when clicked on screen not ClickDetector not Button not UI Not with LocalScript
I want it to detect if the player clicks on the pantry outside the UI
So when clicked on screen not ClickDetector not Button not UI Not with LocalScript
Use a RemoteEvent
and player:GetMouse()
(client-sidedly)
Can you be a little more clear with your instructions?
You need to record the player clicking with their mouse, this has to be done client-sidedly, unless you would use a tool. You could record the player’s postion by using game:GetService("Players").LocalPlayer:GetMouse()
and then using and then using mouse.Hit
, this will return a CFrame
Then you should send via a RemoteEvent
the data you gathered to a server-sided script.
For the client they should fire the remote event like so: RemoteEvent:FireServer(mouse.Hit)
and for the server they should receive the data like so:
local function onClickEvent(playerWhoClicked, cframeOfWhereThePlayerClicked)
end
RemoteEvent.OnServerEvent:Connect()
It depends if what they are saying is, if they want to click on a part, which by the looks of things, they are. Not sure if I’m the only person not understanding.
I mean it seems pretty clear as the topic’s title is “on screen”, but if you want to click a part/model you should use ClickDetector
instead.
I found how I can do:
When detect with Tool
ServerScript:
script.Parent.Activated:Connect(function()
print("Player Clicked on Screen or UI but not Button")
end)
I don’t want move clickdetector’s parent’s Position always,
but if I don’t want use tool, that can be useable