Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make a money Giver script Filtering Enabled?

Asked by 7 years ago

I need help on Make a money giver script that works with Filtering Enabled Please help send a video or anything that WILL Help

Thx Danielevilgamer12

2 answers

Log in to vote
0
Answered by 7 years ago

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):

01local player = game.Players.LocalPlayer;
02local giver = player.PlayerGui.MoneyGui.button;
03local event = game.Workspace.RemoteEvent;
04 
05-- when the button is clicked
06giver.InputBegan:connect(function(input)
07    if(if input.UserInputType == Enum.UserInputType.MouseButton1)then
08        -- fire the event
09        event:FireServer();
10    end
11end)

Server side (script in ServerScriptService):

1local event = game.Workspace.RemoteEvent;
2 
3-- when the event is fired
4event.OnServerEvent:connect(function(player)
5    -- example of giving a player 10 money via leaderboard (which would have to be setup first)
6    player.leaderstats.Money.Value = player.leaderstats.Money.Value + 10;
7end)

Code is not tested

Ad
Log in to vote
0
Answered by 7 years ago

just use remote events or remote functions that is the best way Use This

Answer this question