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

How would I make a script when a player says something it gives them a tool? [Answered]

Asked by 3 years ago
Edited 3 years ago

I'm doing some sort of theater, so I want Team 1 or, receptionists to say a word like "GiveTicket" to a player to give them a ticket tool.

1 answer

Log in to vote
1
Answered by 3 years ago

Put the tool in ReplicatedStorage, then replace the "Ticket" name with the tool name.

local MyMessage = "GiveTicket"
local tool = game.ReplicatedStorage.Ticket

game.Players.PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(msg)
        if msg == MyMessage then
            tool:Clone().Parent = player.Backpack
        end
    end)
end)

Accept the answer if it works!

0
thank you so much! Ponytails2017 83 — 3y
0
Your welcome! WesleyAng_3 153 — 3y
Ad

Answer this question