So, I have this tool giver that gives tools to certain players only. I need help, I don't know what to do!
local ToolNames = {"Bat", "Flashbang", "Glock17", "Baton"} local Storage = game:GetService("ServerStorage") local Part = script.Parent local ClickDetector = Part:WaitForChild("ClickDetector") ClickDetector.MouseClick:connect(function(Player) if plr.Name == "djwchon" or "MimikwMamako" then local Backpack = Player:WaitForChild("Backpack") for i = 1, #ToolNames do local Tool = Storage:FindFirstChild(ToolNames[i]) if Tool then Tool:clone().Parent = Backpack end end end end
On line 9, plr is undefined as you defined the parameter as "Player". Simply change plr to Player and you're set.