I've been trying things like disabling humanoid death if health is more than 0 when dead but it won't work and switching the humanoid when its dead but nothing is working...
My question is that how would i make a revive script if whenever i change the health of a dead humanoid it just goes back to 0?
You'd most likely use Keyboard Input if you wanted the player to press a button if they had died to revive them.
Keyboard Input:
function onKeyPress(actionName, userInputState, inputObject) if userInputState == Enum.UserInputState.Begin then print("The revive button was pressed!") end end game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.R)
Or you could use UserInputService or ContextActionService.
UIS:
function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.R then print("The revive button was pressed!") end end game:GetService("UserInputService").InputBegan:Connect(onKeyPress)
Note that ContextActionService and UserInputService are only client-side services. So you would have to use a Localscript instead of a ServerScript when using it.
Hope this helped!
This question may be locked as it is a request. And I used the wiki for this information, as I do not create scripts for people or fix them if they are requests, as it wastes my time.
First of all, what you're doing is a request which is not allowed here. And second,I'll show you just once:
(Name here) = script.Parent.Humanoid if (Name here).Health = <99 then wait(1) (Name here).Health = +5 if (Name here).Health = 100 then (Name here).Health = +0
Don't thank me yet,I haven't seen anyone ask it before so it is my first time writing such code which means it might not work !