Roblox未知脚本故障

时间:2020-01-04 18:52:05

标签: lua roblox

我已经将roblox的esp脚本制作成这样

local enabled = true
local Fcolor = Color3.new(0,250,0)
local team_color = false -- Set esp color to team color
local plrs = game:GetService("Players")
local lplr = game:GetService("Players").LocalPlayer
local mouse = lplr:GetMouse()
local isTeamBased = false
local function addesp()
    if espforlder then
    else
        espforlder = Instance.new("Folder")
        espforlder.Name = "ESP"
        espforlder.Parent = game.Workspace.CurrentCamera
    end
    for i, v in pairs(espforlder:GetChildren()) do
        v:Destroy()
    end
    for _, plr in pairs(plrs:GetChildren()) do
        if plr.Character and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name then
            local e
            if isTeamBased then
                if plr.Team.Name ~= lplr.Team.Name then
                    e = espforlder:FindFirstChild(plr.Name)
                else
                    e = true
                end
            end
            if not e then
                --print("Added esp")
                local bill = Instance.new("BillboardGui", espforlder)
                bill.Name = plr.Name
                bill.AlwaysOnTop = true
                bill.Size = UDim2.new(1,0,1,0)
                bill.Adornee = plr.Character[Aim_mode]
                local Frame = Instance.new('Frame',bill)
                Frame.Active = true
                if team_color then
                    Frame.BackgroundColor3 = plr.Team.TeamColor.Color
                else
                    Frame.BackgroundColor3 = Fcolor
                end
                Frame.BackgroundTransparency = 0
                Frame.BorderSizePixel = 0
                Frame.AnchorPoint = Vector2.new(.5, .5)
                Frame.Position = UDim2.new (0.5,0,0.5,0)
                Frame.Size = UDim2.new (1,0,1,0)
                Frame.Rotation = 0
                plr.Character.Humanoid.Died:Connect(function()
                    bill:Destroy()
                end)
            else
                print("Not added for "..plr)
            end
        else
            print("Fail 1")
        end
    end
end

while wait() do
    if enabled then
        addesp()
    end
end

在我加载此脚本后,它会正常工作几分钟,然后gui才不会出现。 有时加载后不起作用。 不幸的是,我无法找到导致故障的原因。 它必须从localscript运行。

0 个答案:

没有答案