I need help on Make a money giver script that works with Filtering Enabled Please help send a video or anything that WILL Help
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.
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