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

Can someone fix this it just needs a end? [Unsolved!]

Asked by 10 years ago

I've been trying to fix this script. I can't find what its missing. Help!

local Player=game:GetService("Players").LocalPlayer
local OCServer=game:GetService("ReplicatedStorage").OCServer

--- ClientErrorChecker

game:GetService("ScriptContext").Error:connect(function(error,stack,script)
    OCServer:FireServer({{error,stack,{script:GetFullName(),script.ClassName,script}},"Error"}) 
end)

OCServer:FireServer({{"Character added"..(_G.OCS_NotFirstTime and "" or " - first time")},"Note"})
_G.OCS_NotFirstTime = true

--- ScriptBuilder

local SendData = function(type,...)
    local arg = {}
    local argn = select("#",...)
    if argn > 0 then
        for i = 1,argn do
            arg[i] = tostring(select(i,...))
        end
    end
    OCServer:FireServer({{table.concat(arg,'\t'), "\t---",{"ClientQuickCoding","QuickCode"}},type})
end

local newEnv = setmetatable({},{__index = function(self,index)
    if index == "print" then
        return function(...)
            SendData("Print",...)
        end
    elseif index == "script" then
        return nil
    else
        return getfenv()[index]
    end
end})

OCServer.ScriptBuilder.OnClientEvent:connect(function(source)

1 answer

Log in to vote
0
Answered by 10 years ago

Fixed.

local Player=game:GetService("Players").LocalPlayer
local OCServer=game:GetService("ReplicatedStorage").OCServer

--- ClientErrorChecker

game:GetService("ScriptContext").Error:connect(function(error,stack,script)
    OCServer:FireServer({{error,stack,{script:GetFullName(),script.ClassName,script}},"Error"}) 
end)

OCServer:FireServer({{"Character added"..(_G.OCS_NotFirstTime and "" or " - first time")},"Note"})
_G.OCS_NotFirstTime = true

--- ScriptBuilder

local SendData = function(type,...)
        local arg = {}
        local argn = select("#",...)
        if argn > 0 then
                for i = 1,argn do
                        arg[i] = tostring(select(i,...))
                end
        end
        OCServer:FireServer({{table.concat(arg,'\t'), "\t---",{"ClientQuickCoding","QuickCode"}},type})
end

local newEnv = setmetatable({},{__index = function(self,index)
    if index == "print" then
        SendData("Print", ...)
        return function(...)
    elseif index == "script" then
        return nil
    else
        return getfenv()[index]
    end
end})
Ad

Answer this question