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

My textbox giver doesnt give anybody the tools that I selected?

Asked by 7 years ago

I'm trying to make a giver that will give you coffee if you type "coffee" or "Coffee" into the textbox and hit enter, but the script just isn't working. I took the script out of a custom giver and changed a few things, could someone please help?

I am a noob with scripting, so please go easy on me!

01--[[----------------]]--
02local A = script.Parent.TextBox
03--[[----------------]]--
04if
05    A.text == "Coffee"
06    or
07    A.text == 'coffee'
08    then
09 
10    local allow_duplicates = true
11local allow_team ={
12 
13}
14--[[----------------]]--
15local button = script.Parent
View all 87 lines...

1 answer

Log in to vote
0
Answered by 7 years ago

local ss = game.ServerStorage -- make sure to put the coffee tool in serverstorage and name it "coffee" or "Coffee" but then you need to edit the script. player = game.Players.LocalPlayer

function onChatted(msg)

if string.find(string.lower(msg), string.lower("coffee")) and string.find(string.lower(msg), string.lower("")) then

1if not player.Backpack:FindFirstChild("coffee") then

local coffee = ss:FindFirstChild("coffee"):Clone() coffee.Parent = player.Backpack end end end

game.Players.PlayerAdded:connect(function(OnChatted)

end) -- I personally didn't test it but it should work.

Ad

Answer this question