I need help with techy's dco system

Hello. I use techy’s difficulty chart obby system for my dco. In this system, skipping stages is not compatible with the leaderboard. I hired a scripter to fix this, he fixed it. But I got another bug. Now all functions related to moving through stages have stopped working. Here is my script. Can you help me?
the problem:

My scripts:

Main script:

local settings = require(script.Parent)
local ws = game:GetService(“Workspace”)
local sss = game:GetService(“ServerScriptService”)
local sg = game:GetService(“StarterGui”)
local rst = game:GetService(“ReplicatedStorage”)
local sp = game:GetService(“StarterPlayer”)


local event = Instance.new(“RemoteEvent”, rst)
event.Name = “ChangeStageByTechy”

local function SavingScript()
local script = Instance.new(‘Script’, game.ServerScriptService)
script.Name = “SavingScript”

local Players = game:GetService("Players")
local DataStoreService = game:GetService("DataStoreService")
local SaveDataStore = DataStoreService:GetDataStore(settings.datastoreName)

local function SavePlayerData(player)
	if settings.dataAutosaves then

		local success,errormsg = pcall(function()

			local SaveData = {}

			for i,stats in pairs(player.leaderstats:GetChildren()) do

				SaveData[stats.Name] = stats.Value
			end	
			SaveDataStore:SetAsync(player.UserId,SaveData)
		end)

		if not success then 
			return errormsg
		end		
	end
end	


Players.PlayerAdded:Connect(function(player)

	local Stats = Instance.new("Folder")
	Stats.Name = "leaderstats"
	Stats.Parent = player

	local Stage = Instance.new("NumberValue")
	Stage.Name = "Stage"
	Stage.Parent = Stats
	Stage.Value = 1

	local Data = SaveDataStore:GetAsync(player.UserId)

	if Data then 
		print(Data.Stage)

		for i,stats in pairs(Stats:GetChildren()) do

			stats.Value = Data[stats.Name]		
		end	
	elseif not settings.dataAutosaves then
		print("Autosave is Disabled.")

		player.leaderstats.Stage.Value = 1
	end



	player.CharacterAdded:Connect(function(character)

		local Humanoid = character:WaitForChild("Humanoid")
		local Torso = character:WaitForChild("HumanoidRootPart")

		wait()

		if Torso and Humanoid then
			if Stage.Value ~= 0 then

				local StagePart = workspace.Stages:FindFirstChild(Stage.Value)
				character:MoveTo(StagePart.Position)				
			end	
		end	
	end)		
end)


Players.PlayerRemoving:Connect(function(player)

	local errormsg = SavePlayerData(player)

	if errormsg then	
		warn(errormsg)		
	end	
end)

game:BindToClose(function()
	for i,player in pairs(Players:GetPlayers()) do	

		local errormsg = SavePlayerData(player)
		if errormsg then
			warn(errormsg)
		end			
	end
	wait(2)	
end)

end

local function StageScript()
local script = Instance.new(‘Script’, game.ServerScriptService)
script.Name = “StageScript”

local Stages = workspace:WaitForChild("Stages")

for i,Stage in pairs(Stages:GetChildren()) do

	Stage.Touched:Connect(function(touch)

		local humanoid

		if touch.Parent:FindFirstChild("Humanoid") then

			humanoid = touch.Parent.Humanoid
		end

		if touch.Parent and touch.Parent.Parent:FindFirstChild("Humanoid") then

			humanoid = touch.Parent.Parent.Humanoid
		end

		if humanoid then

			local player = game.Players:GetPlayerFromCharacter(humanoid.Parent)

			local PlayerStage = player.leaderstats.Stage.Value

			if tonumber(Stage.Name) == PlayerStage + 1 then

				player.leaderstats.Stage.Value = player.leaderstats.Stage.Value + 1

			elseif tonumber(Stage.Name) > PlayerStage + 1 then

				humanoid.Health = 0
			end
		end
	end)
end

end


local function StageTransfer()
– This script was fully made by Techyfied
– This script was open-sourced
– For Tutorial or more info, visit Techy's Obby System - All your obby needs in one! [Includes Stage Selector]

local script = Instance.new('Script', game.ServerScriptService)
script.Name = "StageTransfer"

game:GetService("ReplicatedStorage").ChangeStageByTechy.OnServerEvent:Connect(function(player, direction, target)
	local char = game.Workspace:FindFirstChild(player.Name)

	local function teleport()
		local cp = game.Workspace.Stages:FindFirstChild(tostring(player.TeleportedStage.Value))
		local cpp = cp.Position

		char:MoveTo(cpp)
	end


	if direction == "up" then
		--
		player.TeleportedStage.Value = player.TeleportedStage.Value + 1

		if tonumber(player.TeleportedStage.Value) > tonumber(player.leaderstats.Stage.Value) then
			player.TeleportedStage.Value = 1
		end

		teleport()
		--
	elseif direction == "down" then
		player.TeleportedStage.Value = player.TeleportedStage.Value - 1

		if tonumber(player.TeleportedStage.Value) < 1 then
			player.TeleportedStage.Value = player.leaderstats.Stage.Value
		end

		teleport()

	elseif direction == "up2" then
		player.TeleportedStage.Value = player.TeleportedStage.Value + 10

		if tonumber(player.TeleportedStage.Value) > tonumber(player.leaderstats.Stage.Value) then
			player.TeleportedStage.Value = 1
		end

		teleport()
	elseif direction == "down2" then
		player.TeleportedStage.Value = player.TeleportedStage.Value - 10

		if tonumber(player.TeleportedStage.Value) < 1 then
			player.TeleportedStage.Value = player.leaderstats.Stage.Value
		end

		teleport()

	elseif direction == "lobby" then
		player.TeleportedStage.Value = 1		
		teleport()

	elseif direction == "lc" then
		player.TeleportedStage.Value = player.leaderstats.Stage.Value		
		teleport()
	elseif direction == "set" then
		player.TeleportedStage.Value = player.leaderstats.Stage.Value		
		teleport()
	elseif direction == "goto" then
		player.TeleportedStage.Value = target
		teleport()
	end

	if direction == "joined" then
		if settings.dataAutosaves then
			player.TeleportedStage.Value = player.leaderstats.Stage.Value
			teleport()
			print("Moved ".. player.Name.. " to their last stage." )
		end
	elseif direction == "respawned" then
		teleport()
	elseif direction == "respawned2" then
		player.TeleportedStage.Value = player.leaderstats.Stage.Value
	elseif direction == "Resetted" then
		player.leaderstats.Stage.Value = 1
		player.TeleportedStage.Value = 1
		wait(0.1)
		teleport()
	end
end)

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	local tStage = Instance.new("StringValue")
	tStage.Name = "TeleportedStage"
	tStage.Parent = player
	wait(0.5)
	tStage.Value = player.leaderstats.Stage.Value
end)

local function onCharacterAdded(character)
	wait(0.1)
	print("CharacterAdded")
	local plr = Players:FindFirstChild(character.Name)
	local tar = game.Workspace.Stages:FindFirstChild(plr.TeleportedStage.Value)
	local tarp = tar.Position

	if tarp then
		wait(0.5)
		character:MoveTo(tarp)
	end
end

local function onPlayerAdded(player)
	player.CharacterAdded:Connect(onCharacterAdded)
end

end

local TextLabel = Instance.new(“TextLabel”)
TextLabel.Parent = game.StarterGui.StageTransfer
TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
TextLabel.BackgroundTransparency = 1.000
TextLabel.Position = UDim2.new(0.00635323999, 0, 0.962151408, 0)
TextLabel.Size = UDim2.new(0.902160108, 0, 0.0378486067, 0)
TextLabel.Font = Enum.Font.FredokaOne
TextLabel.Text = “”
TextLabel.TextColor3 = Color3.fromRGB(99, 110, 114)
TextLabel.RichText = true
TextLabel.TextSize = 12.000
TextLabel.TextStrokeTransparency = 0.100
TextLabel.TextXAlignment = Enum.TextXAlignment.Left


local function OnRespawn()
local script = Instance.new(“LocalScript”, sp.StarterCharacterScripts)
script.Name = “OnRespawn”

local rps = game:GetService("ReplicatedStorage")

rps.ChangeStageByTechy:FireServer("respawned")

end

local MarketplaceService = game:GetService(“MarketplaceService”)
local productId = settings.skipStageProductID

MarketplaceService.ProcessReceipt = function(receiptInfo)
local players = game.Players:GetPlayers()
local done = 0

for i=1,#players do
	if players[i].userId == receiptInfo.PlayerId then
		if receiptInfo.ProductId == productId and done == 0 then
			done = 1
			players[i].leaderstats.Stage.Value = players[i].leaderstats.Stage.Value + 1
			--players[i].TeleportedStage.Value = players[i].leaderstats.Stage.Value
			players[i].Character:MoveTo(game.Workspace.Stages:FindFirstChild(players[i].leaderstats.Stage.Value).Position)
			done = 0
		end
	end
end
return Enum.ProductPurchaseDecision.PurchaseGranted	

end

if settings.skipStageProductID == 0 then
game.StarterGui:FindFirstChild(“StageTransfer”).SkipStage:Destroy()
end

coroutine.wrap(SavingScript)()
coroutine.wrap(StageScript)()
coroutine.wrap(StageTransfer)()
coroutine.wrap(OnRespawn)()

If you can help me, I will be very grateful to you

Does it output an error? That could help finding the issue.

2 Likes

it seems I only have this error: Workspace.Techy's Obby System.Configurations.Main:319: Touched is not a valid member of Script "Workspace.Stages.StageHandler"

Make sure the instance is whatever the stage is.

if Stage:IsA("BasePart") then
--rest of script
end

(In other words: Make sure it’s an instance that can be Touched)

1 Like

I highly recommend you use a different obby system entirely. What I do for most of my obbies is i use Shnerpy’s Obby System (which only comes with checkpoints and stage transfer) and find a separate skip stage, spectate button and hide players button (which aren’t hard to find and are easily customizable.) Another idea is to use NPT’s Obby System (although it can be very complicated to set up) or even Speed’s DCO kit.

1 Like

Thank you fot your help, I’ll try it! But I’m a pretty bad scripter and it may not work for me

Thank you fot your help too! But I think it’s too late to change the system :confused:

no problem, if there still are some errors feel free to ask

1 Like

Can you clarify from what point I should use this? I don’t quite understand this, sorry

At Line 317 you should have this line:
for i,Stage in pairs(Stages:GetChildren()) do

Put this line below it:
if Stage:IsA("BasePart") then

And make sure to put
end

at the end of the function, below
end)

Thank you for the help again. Unfortunately, I dont have time to test it today, I will tell my result tomorrow :grinning:

I found a script that creates this problem. This script controls checkpoints animation.
Here is the script:

script

for i, stage in pairs(script.Parent:GetChildren()) do
if stage:IsA(“BasePart”) then
local TweeningInfo = TweenInfo.new(
0.5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local Size = stage.Size
local Properites = {
Size = Size + Vector3.new(2,0.2,2),
Transparency = 1
}

	stage:FindFirstChild(stage.Name).Touched:Connect(function(Hit)
		if not stage:FindFirstChild("AlreadyTouched") then
			local String = Instance.new("StringValue")
			String.Name = "AlreadyTouched"
			String.Parent = stage
			local Tween = game:GetService("TweenService"):Create(stage:FindFirstChild(stage.Name), TweeningInfo, Properites)
			Tween:Play()
			stage:FindFirstChild(stage.Name).Color = Color3.fromRGB(40, 172, 0)
			wait(0.6)

			stage:FindFirstChild(stage.Name).Transparency = 0
			stage:FindFirstChild(stage.Name).Size = Size
			stage:FindFirstChild(stage.Name).Color = stage.Color
		end
		
	end)
end

end

1 Like