I got a tool that has this script in it:
script.Parent.Activated:Connect(function()
game.ReplicatedStorage.ToolUseEvent:FireServer()
wait(1)
end)
This tool lays in player's backpack by default.
And i got a server script:
game.ReplicatedStorage.ToolUseEvent.OnServerEvent:Connect(function(Player)
local Soda = game.Players.Player.Backpack --here is the problem
if Soda.RegularSoda then
Player.leaderstats.Sugar.Value = Player.leaderstats.Sugar.Value + 1
end
end)
I need to check if players has a tool called RegularSoda to give him sugar. That is some sort of anti exploiting.
