Hi. Can you tell me whats wrong with this script and why it dos'ent work? this is a gui that gives a vip tool on clicked but it should be detedted by player name on who pressed the button
local vip = {"Revenant101"} function onButtonClicked() local tools = { game.Lighting.Crystal:clone(), game.Lighting.Memory:clone() } for i, v in pairs(vip) do if v:lower() == player.Name:lower() then for t, o in pairs(tools) do o:clone().Parent = player.Backpack end end end end script.Parent.MouseButton1Click:connect(onButtonClicked)
Your problem is you are not defining or finding player. Therefore any further help to you is obsolete until you figure out what arguments the MouseButton1Click returns to the function.