Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Health script can't find the values in players that joined?

Asked by 2 years ago

This script works sometimes and throws an error saying the values aren't in the player when they are.

01local player = game:GetService("Players")
02local creature = require(game.ReplicatedStorage.creature)
03 
04 
05player.PlayerAdded:Connect(function(plr)
06    plr.CharacterAdded:Connect(function(character)
07        --local creature = plr.isvamp.vampt
08 
09        local hum = character:FindFirstChild("Humanoid")
10        if plr:WaitForChild(plr.isvamp.vampt.Value) == "tier1" then
11            hum.MaxHealth = creature.Vampire.tier1.Health
12            hum.Health = creature.Vampire.tier1.Health
13        elseif plr:WaitForChild(plr.isvamp.vampt.Value) == "tier2" then
14            hum.MaxHealth = creature.Vampire.tier2.Health
15            hum.Health = creature.Vampire.tier2.Health
View all 21 lines...
0
Next time you post a question which involves error, please do give the actual error as well SuperSamyGamer 316 — 2y

Answer this question