I am trying to get a forcefeild for all players in one room, and then turn it off when they leave that room. This script is attached to the floor of the room, I tried it in two different ways:
if script.Parent.Touched:connect(function(hit)
if hit.Parent.Humanoid then
game.ReplicatedStorage.ForceField:Clone().Parent = hit.Parent
end
end)
(I put a 'ForceFeild' in ReplicatedStorage)
if script.Parent.Touched:connect(function(hit)
if hit.Parent.Humanoid then
Instance.new("ForceFeild").Parent = hit.Parent
end
end)
Does anyone know why it is not working?

4 comments
try putting .Parent in another lines
Delete the “if” on line 1 in both scripts.
Thank you Denny that was a stupid mistake I don't know why I did that
And I just realized that I spelled forcefield wrong