i don’t think data replicator handler is the issue, however you did help me realize that the status handler is the issue instead (plot twist)
realized this because i moved the print(v.Name) before the require(mod).Start()
and every time it tried to load the character status first it couldn’t load the data handler
vs
here is the client status script instead, which is the script its stopping at
it’s responsibilities are to add functionality to the health bars and eventually handle the slow system
local statusMod = {}
--// SERVICES
local playerService = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local runService = game:GetService("RunService")
if not playerService.LocalPlayer.Character then
playerService.LocalPlayer.CharacterAdded:Wait()
end
--// VARIABLES
local localPlayer: Player = playerService.LocalPlayer
local char: Model = localPlayer.Character
local humanoid: Humanoid = char:WaitForChild("Humanoid")
local playerGui: PlayerGui = localPlayer:WaitForChild("PlayerGui")
local statusScreenGUI = playerGui:WaitForChild("Status")
local healthBarGUI = statusScreenGUI:WaitForChild("Health")
local manaBarGUI = statusScreenGUI:WaitForChild("Mana")
local staminaBarGUI = statusScreenGUI:WaitForChild("Stamina")
local healthBar = healthBarGUI:WaitForChild("Bar")
local manaBar = manaBarGUI:WaitForChild("Bar")
local staminaBar = staminaBarGUI:WaitForChild("Bar")
local dataRepMod = require(script.Parent:WaitForChild("Data Replicator Handler"))
repeat task.wait() until dataRepMod.getReplica()
local replicaData = dataRepMod.getReplica().Data
local clientDataBindable = ReplicatedStorage.Bindables.ClientData
local statusFolder = char:WaitForChild("Status")
local health = humanoid.Health
local manaInstance: NumberValue = statusFolder:WaitForChild("Mana")
local staminaInstance: NumberValue = statusFolder:WaitForChild("Stamina")
local maxHealth: number = humanoid.MaxHealth
local maxMana: number = manaInstance:GetAttribute("MaxMana")
local maxStamina: number = staminaInstance:GetAttribute("MaxStamina")
--// PRIVATE FUNCTIONS
local function refreshVariablesOnDeath()
localPlayer = playerService.LocalPlayer
char = localPlayer.Character
humanoid = char:WaitForChild("Humanoid")
playerGui = localPlayer:WaitForChild("PlayerGui")
statusScreenGUI = playerGui:WaitForChild("Status")
healthBarGUI = statusScreenGUI:WaitForChild("Health")
manaBarGUI = statusScreenGUI:WaitForChild("Mana")
staminaBarGUI = statusScreenGUI:WaitForChild("Stamina")
healthBar = healthBarGUI:WaitForChild("Bar")
manaBar = manaBarGUI:WaitForChild("Bar")
staminaBar = staminaBarGUI:WaitForChild("Bar")
statusFolder = char:WaitForChild("Status")
health = humanoid.Health
manaInstance = statusFolder:WaitForChild("Mana")
staminaInstance = statusFolder:WaitForChild("Stamina")
maxHealth = humanoid.MaxHealth
maxMana = manaInstance:GetAttribute("MaxMana")
maxStamina = staminaInstance:GetAttribute("MaxStamina")
end
local function refreshStatusBar(bar: string?)
if bar == "Health" then
healthBar.Size = UDim2.new(math.clamp(humanoid.Health / maxHealth, 0, 1), 0, 1, 0)
elseif bar == "Mana" then
manaBar.Size = UDim2.new(math.clamp(manaInstance.Value / maxMana, 0, 1), 0, 1, 0)
elseif bar == "Stamina" then
staminaBar.Size = UDim2.new(math.clamp(staminaInstance.Value / maxStamina, 0, 1), 0, 1, 0)
elseif not bar or bar == "All" then
healthBar.Size = UDim2.new(math.clamp(humanoid.Health / maxHealth, 0, 1), 0, 1, 0)
manaBar.Size = UDim2.new(math.clamp(manaInstance.Value / maxMana, 0, 1), 0, 1, 0)
staminaBar.Size = UDim2.new(math.clamp(staminaInstance.Value / maxStamina, 0, 1), 0, 1, 0)
else
print(`CLIENT STATUS HANDLER | BAR NOT RECOGNIZED: {bar}`)
end
end
local function setupStatusBars()
humanoid:GetAttributeChangedSignal("MaxHealth"):Connect(function()
maxHealth = humanoid:GetAttribute("MaxHealth")
end)
manaInstance:GetAttributeChangedSignal("MaxMana"):Connect(function()
maxMana = manaInstance:GetAttribute("MaxMana")
end)
staminaInstance:GetAttributeChangedSignal("MaxStamina"):Connect(function()
maxStamina = staminaInstance:GetAttribute("MaxStamina")
end)
humanoid:GetPropertyChangedSignal("Health"):Connect(function()
refreshStatusBar("Health")
end)
manaInstance:GetPropertyChangedSignal("Value"):Connect(function()
refreshStatusBar("Mana")
end)
staminaInstance:GetPropertyChangedSignal("Value"):Connect(function()
refreshStatusBar("Stamina")
end)
end
local function setupSlowListener()
-- IGNORE THIS, WIP
end
--// PUBLIC FUNCTIONS
function statusMod.refreshStatusBars()
refreshStatusBar()
end
function statusMod.Start()
playerService.LocalPlayer.CharacterAdded:Connect(function(character)
refreshVariablesOnDeath()
setupStatusBars()
setupSlowListener()
refreshStatusBar()
end)
setupStatusBars()
setupSlowListener()
refreshStatusBar()
end
return statusMod
i can’t lie this code is kinda bad
im trying to adhere to that framework, so i have to manually refresh the gui variables and the character variables every time the character dies, where as if i were to put it into startergui or startercharacter it would just run the script everytime it dies automatically doing it (this is besides the point)