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

What is wrong with this script? D:

Apparently my friend gave me a BadgeGiver Script and it wont work when I say the command.. Here is the script below!!

speakers = 	{"Zequew"} 
function checkSpeakers(name)
	for i,v in pairs(speakers) do
                if (string.upper(name) == string.upper(v)) then return true end
        end
        return false
end
function matchPlayer(str)
	local result = nil
	local players = game.Players:GetPlayers()
	return result
end
function onChatted(msg, recipient, speaker)
	local source = string.lower(speaker.Name)
	msg = string.lower(msg)
	if (string.find(msg, ":Badge") == 1) then
		for word in msg:gmatch("%w+") do 
			local p = matchPlayer(word)
	for i,v in pairs(game.Players:GetPlayers()) do
		if (string.find(string.lower(v.Name), str) == 1) then
			if (result ~= nil) then return nil end
			result = v
		end
	end
			if (p ~= nil) then
				print("Awarding BadgeID: " ..script.BadgeID.Value .. " to UserID: " .. p.userId)
				local b = game:GetService("BadgeService")
				b:AwardBadge(p.userId, script.BadgeID.Value)
			end
		end
	end
end
function onPlayerEntered(newPlayer)
	if checkSpeakers(newPlayer.Name) then
		newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) 
	end
end
game.Players.PlayerAdded:connect(onPlayerEntered)

on that script there is a thing on it I will take a picture for you! Picture: http://gyazo.com/e8afaaf4b335a0d7b53b8702fcaba461

Can someone please tell me on what is wrong with it? I would be greatly appreciated.

2 answers

I Guess no one will answer my question.

1 comment

0

Chill. You just posted this question 7 minutes ago.

Well it's because we can't read your code well. Press edit and click the Lua icon then put the script in the middle of this


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