I only want 1 force field in the character at a time. How do I check for this? Btw this is in a local script.~~~~~~~~~~~~~~~~~
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Mat = workspace.Mat
local FF = Instance.new("ForceField")
FF.Parent = Character
Mat.Touched:connect(function(Part)
if Part.Parent:FindFirstChild("Humanoid") and Part.Parent:FindFirstChild("ForceField") then
local FF = Part.Parent:FindFirstChild("ForceField")
FF:Destroy()
end
end)
function InsertFF(Part)
if Part.Parent:FindFirstChild("Humanoid") then
local FF = Instance.new("ForceField")
FF.Parent = Character
end
end
workspace.Baseplate.Touched:connect(InsertFF)
workspace.Floor.Touched:connect(InsertFF)
workspace.Step1.Touched:connect(InsertFF)
workspace.Step2.Touched:connect(InsertFF)
