Workspace: Localscript>ClickDetector>Part
ReplicatedStorage: RemoteEvent
ServerScriptService: Script
The localscript:
script.Parent.MouseClick:Connect(function() game.ReplicatedStorage.PartClicked:FireServer() end)
The script:
game.ReplicatedStorage.PartClicked.OnServerEvent:Connect(function() print("Hello") end)
I can't seem to figure out/understand why it won't work.
MouseClick() can only be handled using a script. See the description on ClickDetectors
So you don't need a remote event at all to check when a player clicks the part.
In the Script
game.Workspace.Part.ClickDetector.MouseClick:connect(function(playerThatClicked) print("Hello "..playerThatClicked.Name.."!") end) --Would Print: --Hello xPolarium!
It should be like this,
REGULAR SCRIPT
local Event = game:GetService("ReplicatedStorage").PartClicked script.Parent.MouseClick:Connect(function() Event:FireServer() end)
SERVER SCRIPT
local Event = game:GetService("ReplicatedStorage").PartClicked Event.OnServerEvent:Connect(function() print("Hello") end)