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

Trying to make a kill command, need a few tips. ?

So, I have an admin script, here is a command.

Commands.print = function(Sender,Arguments)
	local Message = table.concat(Arguments," ")
	print("From " ..Sender.Name..":\n"..Message)
end

I want to make it to where I can kill the player, any help?

4 comments

0

you would probably need a way to get the character then use BreakJoints() or setting the humanoid health to 0

0

Thats what I am trying to do....

0

there is a wiki article on how to make chat commands, hope this helps in some way https://developer.roblox.com/en-us/recipes/Add-Chat-Commands

0

I don't wanna change my whole admin script, LOL.

1 answer

✓ Accepted answer

just :FindFirstChild if there is a player or not, or if you're feeling fancy use a partial match like how I did below. you can use this to have any form of partial match to find a player as well, so you can use it as a template

function PartialMatch(bruhmium)
	if (not bruhmium) then return nil end;
	for i, v in pairs(game.Players:GetPlayers()) do
		if (v.Name:lower():match(bruhmium:lower()) then
			return v;
		end
	end
end


Commands.PartialMatchFunction(Sender,Arguments)
	--We only need the first argument unless you want to modify this to kill a group of people
	local Argument = PartialMatch(Arguments[1]);
	if (not Argument) then return false end;

	--do your stuff to kill the player found
end

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