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

How to do the command !give, !take?

Hello anyone can help me with make give command. I want when I give other guy keycard(tool) then I can't give others this tool. But If I Take this tool I can give anyone. I'd like to command be like this

!give (Username) (ToolName) , !take (Username) (ToolName)

Thanks If you help me :)

2 answers

Remember! Thisi s not a website to ask for scripts, please try making your script before you post the question!

Anyways, put this in ReplicatedFirst, this is a local script:

Short answer: You could use player.Chatted(chatMessage: string)!

Long answer:

local player = game.Players.LocalPlayer -- only for local scripts if you don't know how to use


player.Chatted:Connect(function(chatMessage: string) -- Runs code when a player chats
	if chatMessage:match("!give") or chatMessage:match("/give") then -- Check if chatMessage is "!give"!
		-- Put your "/give" code here!
	elseif chatMessage:match("!take") or chatMessage:match("/take") -- If it is not "!give", check if chatMessage is "!take"!
		-- First put response to /give
		-- Then put "/take" code!
	--[[
	You can add extra commands such as:
	elseif chatMessage:match("!kill") or chatMessage:match("/kill") then
		player.Character.Humanoid.Health = 0
	]]
	end
end)

hey you! have you ever heard of enes? if you are in trouble, better call enes!

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