function OnChatted(msg, speaker) local source = string.lower(speaker.Name) msg = string.lower(msg) --//Commands\\-- if msg == "/e respawn" then speaker:LoadCharacter() elseif msg == "/e sparkles" then Instance.new("Sparkles", speaker.Character.HumanoidRootPart) elseif msg == "/e ff" then Instance.new("ForceField", speaker.Character) elseif msg == "/e run" then speaker.Character.Humanoid.WalkSpeed = 25 elseif msg == "/e walk" then speaker.Character.Humanoid.Walkspeed = 16 elseif msg == "/e sit" then speaker.Character.Humanoid.Sit = true end end game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) OnChatted(msg, player) end) end)
I want to make UnFF but I do not know how,can someone help me?
sometimes players have multiple force fields on. the for loop gets every forcefield. put this with the other elseif's
elseif msg == "/e Unff" then if(speaker.Characater ~= nil)then local character = speaker.Character local charmod = character:GetChildren() for i = 1,#charmod do if(charmod[i].ClassName == "ForceField")then charmod[i]:Destroy() end end end