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

How to make it so players cannot reset?

Asked by
Validark 1580 Snack Break Moderation Voter
9 years ago

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

2 answers

Log in to vote
3
Answered by 9 years ago

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!

0
Thanks a ton! Hope someone else can use this too! Validark 1580 — 9y
0
No problem, glad to help! :D TheeDeathCaster 2368 — 9y
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. Jupiter_Five 0 — 7y
0
@Jupiter_Five You're /pretty/ late man. ;P This was years ago, and since then I've improved. TheeDeathCaster 2368 — 7y
View all comments (3 more)
0
@Jupiter_Five Also, there's nothing in the code that's named "NotReset;" What're you talking about? TheeDeathCaster 2368 — 7y
0
Does it matter what script it is or does it have to be a local script? Rayguyban2 89 — 3y
0
Also I used the Humanoid.Died Function but it does not work why? Rayguyban2 89 — 3y
Ad
Log in to vote
1
Answered by
W8X 95
9 years ago

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

0
If the answer is right, remember to press accept answer. W8X 95 — 9y

Answer this question