I'm making this clickdetector function where, when player clicks, it should call remote event which will then be listened by a script in serverScriptService, Here's Structure
That's script in localScript, But thing is that it does nothing!!! It may not do anything after line2, but it doesn't even print
1 | print ( "hay" ) |
2 | script.Parent.MouseClick:Connect( function (player) |
3 |
4 | game:GetService( "ReplicatedStorage" ).RemoteBuy:FireServer() |
5 | end ) |
LocalScript = ClientScript
Client = Player
LocalScript = Script for Player
Script = ServerScript
Server = Workspace or ServerScriptService and more.
Don't use LocalScript "ClientScript" with the server. Use Script "ServerScript".