Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a money Giver script Filtering Enabled?

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

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.