Health script can't find the values in players that joined?
This script works sometimes and throws an error saying the values aren't in the player when they are.
01 | local player = game:GetService( "Players" ) |
02 | local creature = require(game.ReplicatedStorage.creature) |
05 | player.PlayerAdded:Connect( function (plr) |
06 | plr.CharacterAdded:Connect( function (character) |
09 | local hum = character:FindFirstChild( "Humanoid" ) |
10 | if plr:WaitForChild(plr.isvamp.vampt.Value) = = "tier1" then |
11 | hum.MaxHealth = creature.Vampire.tier 1. Health |
12 | hum.Health = creature.Vampire.tier 1. Health |
13 | elseif plr:WaitForChild(plr.isvamp.vampt.Value) = = "tier2" then |
14 | hum.MaxHealth = creature.Vampire.tier 2. Health |
15 | hum.Health = creature.Vampire.tier 2. Health |
16 | elseif plr:WaitForChild(plr.isvamp.vampt.Value) = = "tier3" then |
17 | hum.MaxHealth = creature.Vampire.tier 3. Health |
18 | hum.Health = creature.Vampire.tier 3. Health |