I've been wondering where to put my code for my state manager at if it should be on client or server since I was learning state manager with ai. Then gpt was saying it should be on client while Claude was saying its good where its at. I know people regularly say that Claude is better than gpt, but I wanted to get an experienced dev's two cents on this. Anyways heres my code:
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(character)
local CharacterHandler = _G.CharacterHandler
local characterData = CharacterHandler.new(character)
--characterData:InitiateAttributeChangedSignal("Stunned")
--characterData:InitiateAttributeChangedSignal("IsAttacking")
-- create more later.
local status = character:WaitForChild("Status")
print("RUNNING!!!")
--local function UpdateMovement()
-- characterData:ControlWalkSpeed()
-- characterData:SetJumpEnabled()
--end
local updateMovement = function()
characterData:UpdateBaseMovement()
print("UPDATE MOVEMENT")
end
status:GetAttributeChangedSignal("Stunned"):Connect(updateMovement)
status:GetAttributeChangedSignal("GuardBreak"):Connect(updateMovement)
status:GetAttributeChangedSignal("Slowed"):Connect(updateMovement)
status:GetAttributeChangedSignal("IsBlocking"):Connect(function()
characterData:ControlWalkSpeed()
end)
status:GetAttributeChangedSignal("Sprinting"):Connect(function()
characterData:ControlWalkSpeed()
end)
status:GetAttributeChangedSignal("IsAttacking"):Connect(function()
characterData:ControlJumpHeight()
end)
--characterData:SetStatus("Stunned", true)
end)
end)
** You are now Level 17! **