I'm at school right now so I won't be able to fully test my script til later but i'm trying to make a safezone styled script if someone hits a brick it'll insert a forcefield in their character and if you hit the other brick it'll take it out
function onTouched(hit)
local f = Instance.new("ForceField") -- is this the right way to insert it
f.Parent = hit.Parent -- is this the right way to put it in the players model
end
script.Parent.Touched:connect(onTouched)
this will be the script to insert the forcefield
function onTouched(hit)
local Player = hit.Parent:findFirstChild("ForceField")
if (Player ~= nil) then -- checks if player is there
hit.Parent.ForceField:remove() -- is this the correct way to remove the forcefield
end
script.Parent.Touched:connect(onTouched)
this will be the script that takes the forcefield out
is this the right way to find the forcefield and insert the forcefield into the player?

1 comment
Thank you