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

How do I make all the players have inf. health for a limited time? [closed]

Asked by 7 years ago

What I mean by that is; when the game starts, everyone will spawn in a lobby. They will be in the lobby for a specific time (27 seconds), and then after 27 seconds I want them to have 100 hp. Please help! Thanks!

Closed as Not Constructive by OldPalHappy

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
-1
Answered by 7 years ago
Edited 7 years ago

This is a easy script.

wait(.2) -- Making sure the character loads.
local ply = game.Players.LocalPlayer -- Getting the player
local char = ply.Character -- Getting the character. You could also do ply:WaitForChild("Character")
local hum = char:FindFirstChild("Humanoid") -- Getting the humanoid
hum.MaxHealth = math.huge -- Giving inf maxhealth
hum.Health = hum.MaxHealth -- Giving inf health
wait(27)
hum.MaxHealth = 100 -- Reverting health to 100

There you go ;)

0
Also, it might be better if you make the lobby revert the health to 100. Cr_eepy 8 — 7y
Ad
Log in to vote
-2
Answered by 7 years ago

This should do it, but you will have to do the part where when they enter the lobby it works

local Player = game:GetService'Players'.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Human = Character:WaitForChild("Humanoid")

Human.MaxHealth and Human.Health = 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -- This is INF
wait(27)
Human.MaxHealth and Human.Health = 100
1
So bad, IDK where to start. cabbler 1942 — 7y
0
I concur with that statement... koolkid8099 705 — 7y