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

I have problem with my commands script (UnFF) Can anyone help me?

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?

4 comments

0

Also,script works pretty well,there are no problems

0

is it a server script

0

The same way you made the sparkles delete them

0

dont request for scripts

1 answer

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
	        

5 comments

1

you know you don't need the () n your conditions and the ~= nil is redundant right? and you're just spoon feeding scripts

0

Uhm, dear incapaz, what is wrong about "spoon feeding scripts"?

0

He liked to write/copy a script, it was HIS choice, KOMKO190 also gave a script, so, there is nothing wrong about "spoon feeding scripts" in this question.

0

Except that it's the script he provided for his question?

0

why did you rate my answer bad for a bad reason :(

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