Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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})

This discussion is preserved as it was. New answers, comments, and votes are closed.