So I’m trying to make an Attribute System, so when you upgrade the damage, you deal more damage.
But the problem is that when I upgrade the Damage, the value in my Attributes Folder (in the player) doesn’t change and is still at 0.
Code which gives me an Attack point when we fire the event :
atkRemote.OnServerEvent:Connect(function(plr)
if not PointsAvailable(plr) then return end
plr.Attributes.Attack.Value += 1
end)
Upgrade Button Code :
local remote = game:GetService("ReplicatedStorage"):WaitForChild("AttributeRemotes"):WaitForChild("AddAttack")
script.Parent.Activated:Connect(function()
if tonumber(script.Parent.Parent.Parent.Total.Value.Text) > 0 then
script.Parent.Parent.Value.Text += 1
script.Parent.Parent.Parent.Total.Value.Text -= 1
remote:FireServer()
end
end)
I also realised that when I test and I change the value manually on the client, it doesn’t work.
However if I change the value manually on the server, it works.
Thanks for the help everyone. But I found out the solution, I deleted the line which checked if we had a point to put, and for some reason, even without that line I couldn’t be able to put one if I had 0 points.