【发布时间】:2021-12-31 02:06:07
【问题描述】:
game.Workspace.PetRooms.FireRoom.FireRoom.Floor.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.parent)
local char = hit.Parent -- Character
local hum = char:FindFirstChild("Humanoid") -- Humanoid
if hum then -- If humanoid then...
if hum.Health ~= 0 and player.Team == game.Teams.Scientists then -- Makes sure that character is not dead; makes sure that character is a scientist
repeat
wait (10)
hum.Health = hum.Health - 10 -- Kills the character slowly
until hum.Health == 0
end
player.Team = game.Teams.Infected -- Changes the player's team to infected AFTER they die
end
end)
“wait(10)”应该在每个“- 10”生命值之间等待 10 秒,但代码只等待 10 秒然后迅速杀死玩家。
【问题讨论】:
-
玩家一开始有多少生命值?
-
拥有 100 点生命值