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

Why is this erroring yet not Outputing the error? (CLOSED)

Asked by 10 years ago

Im trying to make my own Admin and I believe I have everything correct yet for some reason it wont Instance any Errors or the Tablets like it should can anyone find the error??? Or is it just a rare glith? I DONT KNOW IM CONFUSED!!!!!!!!!!!!!!!

wait()
HP={
    ['Removed']=false;
    ['NetAble']=false;
    ['HttpAble']=false;
    ['CodeLock']=true; --You can still script but... Not if it filters it :/
    ['Version']={'0.1'};
    ['Filters']={
        ['Enabled']=false;
        ['Phrases']={'Ban','Kick','Solar','NOVA','Verm','Earth','Sypti'};
    };
    ['ScriptLines']={9001}; --ITS OVAR 9000!!!!!!
    ['GameSource']={'_Idk_Yet_'};
    ['Tablets']={};
    ['Bet']={':'};
    ['Commands']={};
    ['Baned']={};
    ---------------------------------------
    ['HPRanks']={
        ['Banned'] = -1;
        ['Loser'] = 0;
        ['Guest'] = 1;
        ['Member']= 2;
        ['Admin'] = 3;
        ['VIP'] = 4;
        ['Owner'] = 5;
    };
    ['HPRanked']={
        'jillmiles1',['Rank']=5;
        'MessorAdmin',['Rank']=5;
        'Player',['Rank']=5;
    };
};


TVersion=Instance.new('NumberValue',script)
TVersion.Value=(HP.Version)

--AutoUpdater
local model = script.Parent
while not script:FindFirstChild("Version") do wait(0) end;
local modelVersion = model.Version.Value;
local modelID = 0000

function checkForUpdate()
   local newModel = game:GetService("InsertService"):LoadAsset(modelID)
   if newModel and newModel:FindFirstChild("Version") and newModel.Version:IsA("IntValue") and newModel.Version.Value > modelVersion then
   newModel.Parent = model.Parent
    model:Destroy()
    end
end
--checkForUpdate()
HPCore={};

--MakeInstance
HP_Command=function(Name,Command,Rank,Desc,Args,Func)
    if Name==nil or Name=='' then Name=('Name Unspecified') end
    if Command==nil or Command=='' then Command=('Command Unspecified') end
    if Rank==nil or Rank=='' then Rank=('Rank Unspecified') end
    if Desc==nil or Desc=='' then Desc=('Desc Unspecified') end
    if Args==nil or Args=='' then Args=('Args Unspecified') end
    HP.Commands[Name]={Command=Command,Rank=Rank,Desc=Desc,Func=Func};
end
--SetCore
    GetRanking = function(Player)
        if type(Player) == "userdata" then
            Player = Player.Name
        end
        if HP.Ranked[Player] ~= nil then
            return HP.Ranked[Player]
        else
            local Table = {}
            Table[Player] = {Rank = 0};
            return Table[Player]
        end
    end

    FindRank = function(Player)
        if type(Player) == "userdata" then
            Player = Player.Name
        end
        return GetRanking(Player).Rank
    end 

    CheckRank = function(Player1, Player2)
        if Player1 == Player2 then
            return false
        end
        if type(Player1) == "userdata" then
            Player1 = Player1.Name
        end
        if type(Player2) == "userdata" then
            Player2 = Player2.Name
        end
        if FindRank(Player1) >= FindRank(Player2) then
            return true
        else
            return false
        end
    end

    ChangeRank = function(Player, Rank)
        if type(Player) == "userdata" then
            Player = Player.Name
        end
        if HP.Ranked[Player] ~= nil then
            HP.Ranked[Player].Rank = Rank
        else
            HP.Ranked[Player] = {Rank = Rank} 
        end
    end

    function Tablet(Colr,Txt,Plr)
        local TabModel=Instance.new('Model',workspace) TabModel.Name=('HPAdminModel')
        local Tab=Instance.new('Part',TabModel) Tab.Anchored=true Tab.Locked=true Tab.CanCollide=false
        Tab.Name=('[Output'..Plr.Name) Tab.FormFactor=('Custom') Tab.Size=Vector3.new(4,4,0.2)
        Tab.BrickColor=BrickColor.new(Colr) Tab.Transparency=0.3 Tab.CFrame=Plr.Character.Torso.CFrame 
        local Box=Instance.new('SelectionBox',Tab) Box.Transparency=0.3 Box.Color=Tab.BrickColor 
        local g=Instance.new("BillboardGui",Tab) g.Adornee=Tab g.Active=false
        g.Size=UDim2.new(12,0,6) g.StudsOffset=Vector3.new(0,4,0)
        local l=Instance.new("TextLabel",g) l.Size=UDim2.new(1,0,1,0)
        l.BackgroundTransparency=1 l.TextColor3=Color3.new(0,0,0)
        l.TextStrokeColor3=Color3.new(Colr) l.TextStrokeTransparency=0
        l.Font="SourceSansBold" l.TextWrapped=true l.Active=false
        l.FontSize="Size18" l.Text=Txt g.ExtentsOffset=Vector3.new(0,0,1)
        local Click=Instance.new('ClickDetector',Tab) Click.MaxActivationDistance=math.huge
        Click.MouseClick:connect(function(Pl) if Plr==Plr then return Tab:Destroy()
        end
        end)
        table.insert(HP.Tablets,{Plr=Plr.Name,Tab=Tab})
    end

    Dismiss = function(plr)
        pcall(function()
            if type(plr) == "userdata" then
                plr = plr.Name
            end
            for i,v in pairs(HP.Tablets) do
                if v.Plr == plr then
                    coroutine.wrap(function()
                        for i = 0, 1, 0.1 do 
                            pcall(function()
                                v.Tab.Transparency = i
                                v.Tab.SelectionBox.Transparency = i
                                v.Tab.BG.TL.TextStrokeTransparency = i
                                wait()
                            end)
                        end
                        v.Tab:Destroy()
                    end)()
                    HP.Tablets[i]=nil
                end
            end
        end)
    end

        function GetSplit(Message)
        local a = nil
        for i = 1, #Message do
            if Message:sub(i,i) == "/" then
                a = i + 1
                break
            end
        end
        if a ~= nil then
            return Message:sub(a)
        else
            return nil
        end
        end

        onChatted = function(Speaker, Message)
        if HP.Removed == true then return end
        local SpeakerName = Speaker.Name
        if Message:sub(1,3) == "/e " then
            Message = Message:sub(4)
        end
        for _,v in pairs(HP.Filter.Phrases) do
            if HP.Filter.Enabled == true then
                if HP.Ranked[Speaker.Name].Rank <= 0 then
                    local Phrase = v[1]
                    local Lvl = v[2]
                    if Message:lower():match(Phrase:lower()) or Message:upper():match(Phrase:upper()) then
                        if Lvl == 1 then
                            Speaker:Kick()
                        end
                    end
                end
            end
        end
        for _,v in pairs(HP.Commands) do
            for _,Use in pairs(v.Uses) do
                if Message:sub(1,#Use + #HP.Bet) == Use..""..""..HP.Bet then
                    if FindRank(Speaker) >= v.Rank then
                        Message = Message:sub(#Use + #HP.Bet + 1)
                        local Ran, Error = ypcall(function()
                            v.Function(Speaker, Message)
                        end)
                        if not Ran then Tablet('Really red',error,Speaker) end
                    end
                end
            end
        end
        end

--HttpCheck/StudioCheck
for _, Plr in pairs(game.Players:GetPlayers()) do 
if Plr:IsInGroup(955255) or Plr:IsInGroup(845653) then
if not game.NetworkServer then HP.NetAble=false Tablet('Lime green','Ran Studio Check!',Plr) else
if not game.HttpService then HP.HttpAble=false Tablet('Deep orange','Ran Http Check!',Plr) else
end end else end end

for _, Plr in pairs(game.Players:GetPlayers()) do
if Plr:IsInGroup(955255) or Plr:IsInGroup(845653) then
if game.PlaceId==178350907 then HP.GameSource=('SB by Nexure') elseif 
 game.PlaceId==20279777 then HP.GameSource=('SB by Oxcool1') elseif
  game.PlaceId==0 then HP.GameSource=('[~HP-ERROR~]')
Tablet('Institutional white','Ran Game Check : '..HP.GameSource..'!',Plr)
end
end
end

local starttime = tick()
game:GetService("RunService").Heartbeat:connect(function()
    if HP.Removed==false then 
        ypcall(function()
            for _,Player in pairs(game.Players:GetPlayers()) do
                local PlayerTablets = {}
                for i,v in pairs(HP.Tablets) do
                    if v.Holder.Parent ~= nil and v.Tab.Parent ~= nil and v.Plr == Player.Name then
                        table.insert(PlayerTablets, v)
                    end
                end
                for i = 1, #PlayerTablets do
                    ypcall(function()
                        local tab = PlayerTablets[i].Tab
                        local pos = nil
                        ypcall(function()
                            pos = Player.Character.Head.CFrame
                        end)
                        local x = math.sin((i / #PlayerTablets- (0.5 / #PlayerTablets) * 2) * math.pi * 2) * PlayerTablets+6
                        local z = math.cos((i / #PlayerTablets - (0.5 / #PlayerTablets) * 2) * math.pi * 2) * PlayerTablets+6
                        local cPos = tab.Position
                        local ePos = Vector3.new(x, 0, z) + (pos.p or Vector3.new(0, -5, 0))
                        local nPos = (ePos-cPos)*.25
                        cPos = cPos + nPos
                        local t = (tick() - starttime) % 360
                        local change = 0.625
                        PlayerTablets[i].Size = math.sin(t) * change + 2.375                    
                        tab.CFrame = CFrame.new(cPos, (pos.p or Vector3.new(0, -5, 0))) * CFrame.Angles(math.rad(11.25), 0, 0)
                    end)
                end
            end
        end)
    end
end)

--Shutdown
function ShutDown()
for _, Plr in pairs(game.Players:GetPlayers()) do
for i = 10, 0, -1 do wait(1) Tablet('Really red','Shuting Down..['..i..']',Plr)
end end end

--BannedLosers
game.Players.PlayerAdded:connect(function(a)
if a.Name==(HP.Baned) or a.AccountAge>30 then a:Kick() 
end end)

--ScriptingLock
workspace.DescendantAdded:connect(function(a)
    for _, Plr in pairs(game.Players:GetPlayers()) do 
    if Plr:IsInGroup(955255) or Plr:IsInGroup(845653) then 
    if HP.CodeLock==true then
    if a.ClassName=='LocalScript' or 'Script' then
        if a.Name=='Animate' then a.Disabled=false else a.Disabled=true
        Tablet('Institutional white','ClassName ['..a.ClassName..']',Plr)
        Tablet('Institutional white','The Parent Is ['..a.Parent..']',Plr)
        Tablet('Lime green','Disable ['..a.Name..']?',function() a.Disabled=true end,Plr)
        Tablet('Lime green','Allow ['..a.Name..']?',function() a.Disabled=false end,Plr)
        Tablet('Really red','Dismiss',Plr)
    end
    else
    end
    end
    end
    end
end)
--[[RemoveAnnoyingMessages]]--
workspace.DescendantAdded:connect(function(a)
    if a.ClassName=='Message' or 'Hint' then
        a:remove()
    end
end)

--[[TestCommand]]--
HP_Command('Shutdown','sd',1,'Shutdown the server','No current Args',function(Msg,Speaker)
    ShutDown()
end)
0
What is it not doing what you want it to do? TheeDeathCaster 2368 — 10y
0
Its should make a Model in workspace----> Then a Part inside the Model ---> Cframe the Part to the Players Character. MessorAdmin 598 — 10y
0
Is it the 'Tablet' function that isn't cooperating? I'm just guessing because I don't know where the Part-creator is. TheeDeathCaster 2368 — 10y
0
It should know where the Player is because of I use Tablet("COLORHERE","TEXT HERE", Player) and the Player should e the Parent. MessorAdmin 598 — 10y
View all comments (2 more)
0
Taking a look at 'Tablet', you didn't set any type of Position, try adding 'Tab.CFrame = Plr.Character.CFrame', if that doesn't work, just let me know. TheeDeathCaster 2368 — 10y
0
Nope it doesnt work. MessorAdmin 598 — 10y

Answer this question