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

Basic Admin custom command not working?

Asked by 4 years ago
Edited 4 years ago

Hey. I'm trying to make a host command with Basic Admin Essentials. Also filteringenabled is turned off. (This is the code)

    -- Plugin Configuration --
    local pluginName = 'host'
    local pluginPrefix = Prefix
    local pluginLevel = 3
    local pluginUsage = "<User(s)>" -- leave blank if the command has no arguments
    local pluginDescription = "Host a server."

    -- Example Plugin Function --
    local function pluginFunction(Args) -- keep the name of the function as "pluginFunction"
        local Player = Args[1]
        while true do
           game.StarterGui.HostInfo.TextLabel.Text = 'Host: '..Player
        end
    end

When I test the command (on studio) this error comes up: Function Error - ServerScriptService.Basic Admin Essentials2.0.Plugins.Example Plugin:48: Attempt to concatenate local 'Player' (a userdata value)

0
Make sure that the Basic Admin Essentials is placed in ServerScriptService.. SilentsReplacement 468 — 4y
0
Also try removing any extra spaces.. SilentsReplacement 468 — 4y
0
Done that now but hasn’t worked :/ maxximusking890 5 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Attempt to concatenate local 'Player' (a userdata value) is the key here. you can only concatenate numbers with strings, or tables with a string(as long as the table has a meta-table with __tostring())

so looking at your code, i think you meant to do: game.StarterGui.HostInfo.TextLabel.Text = 'Host: '.. (Player.Name)

Ad

Answer this question