When filtering is enabled, the client cannot alter server side components without the server's authorization. So, to run a function on the server from the client, you have to use RemoteEvents and RemoteFunctions. RemoteEvents and RemoteFunctions are objects that can be placed in the game hierarchy.
http://wiki.roblox.com/index.php?title=API:Class/RemoteEvent
Try something like this (click a button on a gui to add 10 money to leaderboard):
Client side (localscript in StarterPlayerScripts):
01 | local player = game.Players.LocalPlayer; |
02 | local giver = player.PlayerGui.MoneyGui.button; |
03 | local event = game.Workspace.RemoteEvent; |
06 | giver.InputBegan:connect( function (input) |
07 | if ( if input.UserInputType = = Enum.UserInputType.MouseButton 1 ) then |
Server side (script in ServerScriptService):
1 | local event = game.Workspace.RemoteEvent; |
4 | event.OnServerEvent:connect( function (player) |
6 | player.leaderstats.Money.Value = player.leaderstats.Money.Value + 10 ; |
Code is not tested