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

Fully Remove Reset Function? Reset Preventer?

This may seem pretty easy to all of you guys, but just needing help with a few touches. Let's say my walkspeed is 16, and it changes to 0. When I reset my character, it actually resets my character. Usually, once I reset my character while my walkspeed is 16, it won't reset. But once I go to 0 walkspeed, the whole script wouldn't work fully. If you can help me figure out how to not have it reset my character fully, that would be awesome. Thanks (:

--Made by Resplendid
--For LukeGabrieI
local plr = game.Players.LocalPlayer repeat wait() until plr.Character and plr.Character:FindFirstChild("Humanoid")
local hum = plr.Character['Humanoid'] 

hum.HealthChanged:connect(function(health) 
	if health<= 0 then hum.Health = hum.MaxHealth plr.Character:MakeJoints()
	end
end)

Here's some more, if it helps. :D

function onPlayerEntered(newPlayer)
newPlayer.Character.Humanoid.WalkSpeed = 16 --Change this number to change speed. 16 is normal speed.
end
game.Players.ChildAdded:connect(onPlayerEntered)
local plr = game.Players.LocalPlayer 
local hum = plr.Character['Humanoid'] 

hum.HealthChanged:connect(function(health) 
	if health<= 0 then hum.Health = hum.MaxHealth plr.Character:MakeJoints()
		repeat wait() 
			until plr.Character and plr.Character:FindFirstChild("Humanoid")
	end
end)

function onPlayerRespawned(newPlayer)
h = newPlayer:findFirstChild("Humanoid")
if h ~= nil then
if game.Workspace:findFirstChild(h.Parent.Name) ~= nil then
h.WalkSpeed = 16 --Make sure this number is the same as the number above.
while true do
	if h.Walkspeed == 0 then
		h.Health = h.MaxHealth plr.Character:MakeJoints()
	end
end
end

game.Workspace.ChildAdded:connect(onPlayerRespawned)

--Coreyscripter

I just wanna make sure once my Walkspeed turns to 0, I do not have the ability to reset my character anymore. Thing is I don't want to change "Humanoid" cause my game requires it to play.

-LukeGabrieI

1 answer

✓ Accepted answer

Ok, that won't work. Once the humanoid reaches 0, you won't' be able to revive the character like that without respawning. If you wanted to make your custom health script, then that's actually simple. Simply set a IntValue in the Player. Once it reaches 0, kill them or move them to where you want them to be, or take the count, etc. Also, it would be better if you split the first script's line 7 into 2 lines since you aren't ending it in the same line (make a new line after 'then').... Also, if you want the speed to be 0, just anchor the player's character and they won't move. I'd provide a script if you want, just tell me what you want (you have many errors in terms of formats) - I'll gladly show you how to make a custom health system. You have more freedom once you do that

3 comments

0

Also humanoid does not go into negatives)

0

Yes please! That would be awesome. I just want a script that won't reset my character, lol. That's it, but also keeping Humanoid, because I've seen Reset Preventers that change Humanoid to something else in order for it to not reset. That's NOT what I want. But a custom health system would be great! Thank you so much! (:

0

Giving an alternate solution here: TheGamer101 recently added a method to manipulate the reset button's logic by setting a callback. By using that method, you can disable resetting with ease. More info: http://devforum.roblox.com/t/customizable-reset-button-logic/30463

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