Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

This script should make player's health=to his level*100 but it works in roblox studio can you help?

Here is the script

local Player = game.Players.LocalPlayer --get the local player

local LVL = Player:WaitForChild("LevelingSystem"):WaitForChild("Lvl") --common reason as to why some LocalScripts don't work in studio, things haven't loaded in

LVL:GetPropertyChangedSignal("Value"):Connect(function()

    Player.Character.Humanoid.MaxHealth = LVL.Value * 100

    Player.Character.Humanoid.Health = Player.Character.Humanoid.MaxHealth

end)

1 answer

✓ Accepted answer

try this

local Player = game.Players.LocalPlayer --get the local player

local LVL = Player:WaitForChild("LevelingSystem"):WaitForChild("Lvl") --common reason as to why some LocalScripts don't work in studio, things haven't loaded in

LVL:GetPropertyChangedSignal("Value"):Connect(function()

    Player.Character.Humanoid.MaxHealth = LVL.Value * 100
wait(0.1)
    Player.Character.Humanoid.Health = Player.Character.Humanoid.MaxHealth

end)

2 comments

0

still nothing :/ do you have any other idea

0

nvm it works thanks a lot mateeee

This discussion is preserved as it was. New answers, comments, and votes are closed.