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

Why doesn't this script work?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
    while wait(0.2) do
        if keys["p"] then
            print "Replacing the idol"
            Player.Backpack.Bag:Destroy()
            local idol = game.ServerStorage.Idol:Clone()
            idol.Parent = Player.Backpack
        end
    end

I already have Player defined earlier in the script. This is supposed to, when 'P' is pressed, remove the tool called "Bag" and clone the tool called "Idol" into the backpack.

Answer this question