Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How could i add a script to an uncollidable wall that will remove ff?

I have no idea where to start.

1 comment

0

I'm assuming ff means force field.

2 answers

✓ Accepted answer

Try putting this in your wall ;8 Hope it works.

function onTouched(hit)
    hit.Parent.ForceField:Destroy()
end

script.Parent.Touched:connect(onTouched)

1 comment

0

What if the Force Field doesn't exist? This would throw you an error.

This is simple,

Let's start with the Touched Event,

script.Parent.Touched:connect(function(part)
	--Code later
end)
I'm using anonymous functions.

The touched event returns the part that touched whatever it's detecting.

Let's get the parent and look for a force field in the parent,

-- Regular Script
script.Parent.Touched:connect(function(part)
	if part.Parent:FindFirstChild("ForceField") then
		-- code later
	end
end)

Here's a link to a gif of what the Force Field looks like inside of the character,

Now that we know the Force Field exists, let's delete it,

-- Regular Script
script.Parent.Touched:connect(function(part)
	if part.Parent:FindFirstChild("ForceField") then
		part.Parent:FindFirstChild("ForceField"):Destroy()
	end
end)

And that's about all!

I Hope I Helped!

Good Luck!

If I did help, please don't forget to accept this answer! It helps a lot.

This discussion is preserved as it was. New answers, comments, and votes are closed.