Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to do the command !give, !take?

Asked by 2 years ago
Edited 2 years ago

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

Log in to vote
0
Answered by
ryanzhzh 128
2 years ago
Edited 2 years ago

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)

Ad
Log in to vote
0
Answered by
enes223 327 Moderation Voter
2 years ago

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

Answer this question