I would like the player's max health value to be 300 times their health stat value, but I'm unsure how to call the humanoid in my scripts. Both scripts are regular scripts Stats script:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
-- Level
local level = Instance.new("IntValue")
level.Name = "Level"
level.Value = 0
level.Parent = player
--Stats
local strengthvalue = Instance.new("IntValue", char)
strengthvalue.Name = "Combat"
strengthvalue.Value = 1
strengthvalue.Parent = player
local healthvalue = Instance.new("IntValue", char)
healthvalue.Name = "Endurance"
healthvalue.Value = 1
healthvalue.Parent = player
local staminavalue = Instance.new("IntValue", char)
staminavalue.Name = "Fortitude"
staminavalue.Value = 1
staminavalue.Parent = player
local modevalue = Instance.new("IntValue", char)
modevalue.Name = "Energy"
modevalue.Value = 1
modevalue.Parent = player
--Balance and Avail Stats
local bal = Instance.new("IntValue")
bal.Name = "Balance"
bal.Value = 0
bal.Parent = player
local availstats = Instance.new("IntValue", char)
availstats.Name = "AvailableStats"
availstats.Value = 0
availstats.Parent = player
end)
end)
Max Health script:
game.Workspace:WaitForChild("Character").Humanoid.MaxHealth = 300 * game.Players.LocalPlayer.Endurance.Value

1 comment
You can't have Local player in a regular script. How about you just combine both script so you can reference the player.