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 4 years ago
Edited 4 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 4 years ago

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

01local MyMessage = "GiveTicket"
02local tool = game.ReplicatedStorage.Ticket
03 
04game.Players.PlayerAdded:Connect(function(player)
05    player.Chatted:Connect(function(msg)
06        if msg == MyMessage then
07            tool:Clone().Parent = player.Backpack
08        end
09    end)
10end)

Accept the answer if it works!

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

Answer this question