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

local player = game.Players.LocalPlayer;
local giver = player.PlayerGui.MoneyGui.button;
local event = game.Workspace.RemoteEvent;

-- when the button is clicked
giver.InputBegan:connect(function(input)
    if(if input.UserInputType == Enum.UserInputType.MouseButton1)then
        -- fire the event
        event:FireServer();
    end
end)

Server side (script in ServerScriptService):

local event = game.Workspace.RemoteEvent;

-- when the event is fired
event.OnServerEvent:connect(function(player)
    -- example of giving a player 10 money via leaderboard (which would have to be setup first)
    player.leaderstats.Money.Value = player.leaderstats.Money.Value + 10;
end)

Code is not tested

Ad
Log in to vote
0
Answered by 6 years ago

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

Answer this question