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
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
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
just use remote events or remote functions that is the best way Use This
This discussion is preserved as it was. New answers, comments, and votes are closed.