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

How to fix this?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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)
4
Where is player defined? Articulating 1335 — 10y
0
player is us Revenant101 25 — 10y

1 answer

Log in to vote
0
Answered by
Vathriel 510 Moderation Voter
10 years ago

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.

0
I don't Understand, what do you mean not finding or defining its in line 13 Revenant101 25 — 10y
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. Vathriel 510 — 10y
0
oh so thats what u mean could have make it clearer... Revenant101 25 — 10y
Ad

Answer this question