Top.Mail.Ru
Ответы

Знающие в Roblox Studio,помогите!

Как сделать в скрипте на лаву так, чтобы объект Fire при касании создавался только один раз?

По дате
По рейтингу
Аватар пользователя
Ученик

скрипт:

local function havefire(part)
if part then
if part:FindFirstChild("Fire")~=nil then
return true
else
return false
end
end
end

script.Parent.Touched:Connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
if hum.Parent:FindFirstChild("Torso") then
local havefire = havefire(hum.Parent.Torso)
if havefire==true then
--нет
else
Instance.new("Fire",hum.Parent.Torso)
end
elseif hum.Parent:FindFirstChild("LowerTorso") then
local havefire = havefire(hum.Parent.LowerTorso)
if havefire==true then
--нет
else
Instance.new("Fire",hum.Parent.LowerTorso)
end
end
end
end)

Аватар пользователя
Ученик
5мес

local lava = script.Parent
local function killPlayer(otherPart)
local partParent = otherPart.Parent
local humanoid = partParent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
end
end
lava.Touched:Connect(killPlayer)
(при наступление на блок лавы ты дохнешь)

Аватар пользователя
Знаток

На ютубе поищи