ok so im trying to make it so the higher your defense stat the more health you have, the part im stuck on is the server script. I have no idea on what to put here so any tips and advice would be great.
local event = game.ReplicatedStorage:WaitForChild("Def") event.OnServerEvent:Connect(function(player) --change INT VALUE here end)
This is where my Defense stat is stored if that helps
local Stats = player:WaitForChild("Stats") local Strength = Stats:FindFirstChild("Defense")
local event = game.ReplicatedStorage:WaitForChild("Def") event.OnServerEvent:Connect(function(player) local Stats = player:WaitForChild("Stats") local Strength = Stats:FindFirstChild("Defense") local humanoid = player.Character and player.Character:FindFirstChild("Humanoid") humanoid.MaxHealth = Strength*ratioofstrengthtomaxhealth end)
local event = game.ReplicatedStorage:WaitForChild("Def") local DefaultHealth = 10 event.OnServerEvent:Connect(function(player) local Stats = player:WaitForChild("Stats") local Strength = Stats:FindFirstChild("Defense") local char = plr.Character or plr.CharacterAdded:wait() if char then local hum = char:FindFirstChild("Humanoid") if hum then hum.MaxHealth = DefaultHealth * Strength.Value end end end)