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

[Solved]Does roblox not allow you to set the players health higher than 100?

Asked by 5 years ago
Edited 5 years ago

Here is my script:

            elseif string.lower(string.sub(msg, 1, 6)) == "health" then

                local strPlayerHealth = string.match(msg, "%d+")
                print(strPlayerHealth) -- output 500
                if strPlayerHealth then
                    print("got here")
                    local numPlayerHealth = tonumber(strPlayerHealth)

                    if numPlayerHealth <= 1000 then
                    print("Got here")
                    humanoid.Health = numPlayerHealth
                    print(humanoid.Health) -- output 100

                    end
                end
            end

what is going on here? Thanks for any help!

0
You need to update the max helth before setting the new hp User#5423 17 — 5y
0
Thanks guys! Got it to work. User#21908 42 — 5y

Answer this question