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

Why doesn't my custom Adonis plugin command work?

Asked by 4 years ago

Here is the code:

server = nil -- Mutes warnings about unknown globals
service = nil
return function()
    server.Commands.Gun = {
            Prefix = server.Settings.Prefix; 
            Commands = {"gun"}; 
            Args = {"player"}; 
            Description = "The said player gets a gun."; 
            Fun = true; 
            Hidden = false; -- 
            AdminLevel = "Moderators"; 
            Function = function(plr,args) 
                for i,p in pairs(service.GetPlayers(plr,args[1])) do 
                    game:GetService("InsertService"):LoadAsset(116693764).Parent = plr.Backpack         
            end
        end
    }
end

0
Why are you using global variables? Use local variables. They're like vegetables, they're good for u programmerHere 371 — 4y
0
What variables should I change to local variables MaciBoss1950 16 — 4y
0
All of them programmerHere 371 — 4y
0
In fact, never use global variables. There is no use for them. programmerHere 371 — 4y
View all comments (3 more)
0
How does that even help? MaciBoss1950 16 — 4y
0
When I say :gun in the chat it doesn't do nothing, it doesn't even give me an error MaciBoss1950 16 — 4y

Answer this question