Why isnt myy statpoint system working?
Asked by
5 years ago Edited 5 years ago
--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)