--local script
local remote = game.ReplicatedStorage.Remotes.DmgM
local plr = game.Players.LocalPlayer
local gui = script.Parent


gui.MouseButton1Click:Connect(function()
		remote:FireServer()
end)

--server script
local remote = game.ReplicatedStorage.Remotes.DmgM

remote.OnServerEvent:Connect(function(plr)
		if plr.leaderstats.StatPoints.Value >= 1 or plr.leaderstats.StatPoints.Value == 1 then
		game.ReplicatedStorage.Dmg.Value = game.ReplicatedStorage.Dmg.Value + 5
		plr.leaderstats.StatPoints.Value = plr.leaderstats.StatPoints.Value - 1
		game.ReplicatedStorage.PlusDmg.Value = game.ReplicatedStorage.PlusDmg.Value + 5
		end
end)

1 comment

0

You trust the client too much