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

How to fix this?

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)

2 comments

4

Where is player defined?

0

player is us

1 answer

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.

3 comments

0

I don't Understand, what do you mean not finding or defining its in line 13

0

You can't just be like "Oh I want a player, so lets just say player" NO. You need to define the player, right now player is nil, so that is your problem, come back when your not using free models.

0

oh so thats what u mean could have make it clearer...

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