LOCAL SCRIPT
while(true) do
totalStancePoints = char:GetAttribute("StancePoints")
if totalStancePoints == nil then
totalStancePoints = 4
end
totalStancePoints += 1
if totalStancePoints > 4 then
totalStancePoints = 4
end
warn(totalStancePoints)
setStancePoints:FireServer(totalStancePoints)
updateStanceGUIEvent:Fire(totalStancePoints)
task.wait(1)
end
SERVER SCRIPT
setStancePoints function:
local rs = game:WaitForChild("ReplicatedStorage")
local setStancePoints = rs.SetStancePoints
local stateManager = require(rs.StateManager)
setStancePoints.OnServerEvent:Connect(function(plr, number)
stateManager.SetPermState(plr, "StancePoints", number)
end)
MODULE SCRIPT
stateManager function:
function module.SetPermState(plr, stateKey, value)
plr:SetAttribute(stateKey, value)
end
** You are now Level 9! **