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

Unequip tool if inside FF ?

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(chr)
	while true do
		if chr.ForceField ~= nil then
chr.Humanoid:UnequipTools()
		end
	end
end)
end)

--need to fix

the script above does not work and i am wondering how to make one.

1 comment

0

Also, you have to make sure that a force field event exists upon spawning. So, if you have a Spawn from studio, then it should probably be there.

1 answer

✓ Accepted answer

Hey Elixcore, Your problem is very simple to fix, I will just show it below rather than explaining it up here because it's easier that way.

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		while wait() do -- You should have a wait for a while loop just in-case it runs too long.
			if char:FindFirstChild("ForceField") then -- Checks if Force Field exists in the character
				local hum = char:WaitForChild("Humanoid");
				hum:UnequipTools();	
			end
		end
	end)
end)

Well, I hope I helped and have a nice day!

~~ KingLoneCat

2 comments

0

Thank you soo much! it works perfectly!

0

No problem.

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