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

I need help changing health for vampires in my game?

Asked by 1 year ago

So I have a full script built off of DataStore2 to ease my troubles of creating/maintaining tables which I'll admit I need help on but aside from that I got it working by creating stats inside the player's folder which then gets a few things couple of them being isVampire and vampt

vampt is the tier of vampire so like in Skyrim's vampire mod, BetterVampires, their level system is built upon necks bitten so far I have a brick that when you click it is the neck and so forth. I am having an issue setting the health for these particular people. Here's the code in question.

game.Players.PlayerAdded:Connect(function(plr)
        plr.CharacterAdded:Connect(function(Char)
            local starthum = Char:FindFirstChildWhichIsA("Humanoid") or Char:WaitForChild("Humanoid")
            if plr.isvamp.vampt == "tier1" and Char.Health == 100 then
                starthum.MaxHealth = creature.Vampire.tier1.Health.Value
                starthum.Health = starthum
            end
        end)

This is obviously a small snippet of a larger code if you want that just reply and ask I'll shoot you the info. I have a table in a modulescript labeled creatures where I am storing the whole list of attributes I can link that as well just need to crack this to move on. And if you're interested in helping out the group is basically good v evil with two sides of exploration and small events throughout the area that are player hosted.

Answer this question