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

How to make it so players cannot reset?

Should be relatively simple, I just have no idea how to do it.

2 answers

✓ Accepted answer

I don't really change the Name property of the Humanoid anymore, due to it sometimes breaking some scripts, now, I just use the MakeJoints method to keep the Player from falling apart, and the HealthChanged event of the Humanoid to detect when the Player's Health has changed, here is what I mean;

local plr = game.Players.LocalPlayer --Variable 'plr' will specify/identify the LocalScript's Client
repeat wait() until plr.Character and plr.Character:FindFirstChild("Humanoid") --The 'repeat' loop will repeat/yield the code until the Player's Character is existant, and the Player's 'Humanoid' is existant within the Player's Character
local hum = plr.Character['Humanoid'] --Variable 'hum' is now specifying the Player's 'Humanoid'

hum.HealthChanged:connect(function(health) --Here is the 'HealthChanged' event; This will fire when a 'Humanoid''s Health property has changed, and variable/argument 'health' is specifying the 'Health' property
if health<= 0 then --The 'if' statement is checking to see if the 'Health' property is less than or equal to '0'
hum.Health = hum.MaxHealth --If so, reverts the Player's Health to full
plr.Character:MakeJoints() --Remakes the 'Joints' on the Player's Character
end --This ends the chunk for the 'if' statement
end) --This ends the chunk for the function

Hope this helped!

7 comments

0

Thanks a ton! Hope someone else can use this too!

0

No problem, glad to help! :D

0

Adding a check to see if there is an object called "NotReset" in the character would allow your character to die at certain points.

0

@Jupiter_Five You're /pretty/ late man. ;P This was years ago, and since then I've improved.

0

@Jupiter_Five Also, there's nothing in the code that's named "NotReset;" What're you talking about?

0

Does it matter what script it is or does it have to be a local script?

0

Also I used the Humanoid.Died Function but it does not work why?

Try re-naming the persons Humanoid, it should work, although it might break some other stuff.

1 comment

0

If the answer is right, remember to press accept answer.

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