Script not working on a new baseplate

I made a climbing script that works perfectly on the baseplate where I developed it, but it breaks whenever I put it on a different baseplate. The script calls a function FailedJumps() that creates QTEs; when the QTEs succeed the player can move along the ledge. After exporting the exact same script (copied) to another baseplate, the ledge movement fails. Both baseplates use R6 and I compared their properties, but nothing fixes it. If I stop calling FailedJumps() the movement works normally, so the problem appears to be caused by that function while it shouldnt since its the same as the working one.

function FailedJumps()
	if FJDebounce == false then
		FJDebounce = true

		Track:Play()
		IdleTrack:Stop()
		Debounce2 = true
		DisableAllBools()

		task.wait(1)

		local Count = 0
		local info = TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
		local stop = false

		local ScreenGui = Instance.new("ScreenGui", plr.PlayerGui)
		ScreenGui.IgnoreGuiInset = true
		local frame = Instance.new("Frame", ScreenGui)
		frame.Size = UDim2.new(1,0,1,0)
		frame.Position = UDim2.new(0.5,0,0.5,0.5)
		frame.AnchorPoint = Vector2.new(0.5,0.5)
		frame.Transparency = 1



		for i=1, ConfigModule.Get().QTEcount do
			if not stop then


				local letters = {"A","D"}
				local choix = letters[math.random(#letters)]

				local bgimg = Hexagone:Clone()
				bgimg.Parent = frame
				bgimg.Size = UDim2.new(0.08, 0, 0.18, 0)
				bgimg.AnchorPoint = Vector2.new(0.5, 0.5)
				bgimg.Position = UDim2.new((math.random(0,100) / 100)/2, 0, (math.random(0,100) / 100)/2, 0)
				bgimg.ImageTransparency = 0.1

				local TextButton = Instance.new("TextButton", frame)
				TextButton.Size = UDim2.new(0.01, 0, 0.05, 0)
				TextButton.BackgroundColor3 = Color3.new(0, 0, 0)
				TextButton.BackgroundTransparency = 1
				TextButton.Position = bgimg.Position
				TextButton.AnchorPoint = Vector2.new(0.5, 0.5)
				TextButton.TextColor = BrickColor.new("Black")
				TextButton.RichText = true
				TextButton.TextScaled = true
				TextButton.Text = choix
				TextButton.Font = Enum.Font.Oswald
				TextButton.FontFace = Font.new(
					"rbxasset://fonts/families/Oswald.json",
					Enum.FontWeight.Bold,
					Enum.FontStyle.Normal
				)



				ts:Create(TextButton, info, {Size = UDim2.new(0.1, 0, 0.15, 0)}):Play()

				local UiCorner = Instance.new("UICorner", TextButton)

				TextButton.MouseButton1Click:Connect(function()
					Count += 1
					frame:FindFirstChild("TextButton"):Destroy()
				end)

				UIS.InputBegan:Connect(function(input)

					if choix ~= nil then
						if input.KeyCode == Enum.KeyCode[choix] then
							Count += 1
							choix = nil

							ts:Create(bgimg, info, {ImageColor3 = Color3.new(0.372549, 1, 0.101961)}):Play()
							LedgeVerificator()
							IsAtEdges()

						else
							print("fail")
							stop = true
							Track:Stop()
							ts:Create(bgimg, info, {ImageColor3 = Color3.new(1, 0, 0.0156863)}):Play()
							FJDebounce = false
							LedgeVerificator()
							IsAtEdges()
							ToGround()
							task.wait(1)
							Debounce2 = false
							return
						end
					end
				end)

				task.wait(1)

				choix = nil

				if frame:FindFirstChild("TextButton") then
					frame:FindFirstChild("TextButton"):Destroy()
				end

				if frame:FindFirstChild("Hexagone") then
					frame:FindFirstChild("Hexagone"):Destroy()
				end

				if i >= ConfigModule.Get().QTEcount then --succeded qte
					print(Count)
					Track:Stop()
					if Count >= ConfigModule.Get().QTEcount then
						FJDebounce = false
						LedgeVerificator()
						IsAtEdges()
						IdleTrack:Play()
						EnableAllBools()
						task.wait(1)
						Debounce2 = false
						CAN_JOINT_MOVE_ANIM = true
						return true
					else
						ToGround()
						LedgeVerificator()
						IsAtEdges()
						FJDebounce = false
						task.wait(1)
						Debounce2 = false
						return false
					end
				end
			end
		end
	end
end

If you need more details, tell me

Hello!

Maybe it’s because the second (red) ledge is lower than the first (green) ledge?

1 Like

It is not since the script is adapted for this, but incase, i already tried to change its position and size without succeeding

is fail printed? and if not what is the difference between Count & ConfigModule.Get().QTEcount in the succeeded qte check

Fail is propely printed and count is something that i forgot to delete, it doesnt have an utility

If count isn’t used what happens when you remove this?

I was mistaken it does have an utility, my bad. Count is the current succedeed QTE and ConfigModule.Get().QTEcount is the total of QTE

Ok, when you move between parts is does this value change? Count >= ConfigModule.Get().QTEcount

TextButton.MouseButton1Click:Connect(function() & UIS.InputBegan:Connect(function(input) don’t seem to be disconnected, I’m not 100% sure, but they could be called after you finish what happens if you switch from Connect to Once

It also doesnt works with “Once” instead of “Connect”, i completly removed the UIS part like shown down here, and i still get the same bug. It is probably something external of the function causing the issue even though i get the glitch only by calling the function

local FailedClimbAnimation = script.FailedClimb
local Track = hum:LoadAnimation(FailedClimbAnimation)
local FJDebounce = false

function FailedJumps()
	if FJDebounce == false then
		FJDebounce = true

		Track:Play()
		IdleTrack:Stop()
		Debounce2 = true
		DisableAllBools()

		task.wait(1)

		local Count = 0
		local info = TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
		local stop = false

		local ScreenGui = Instance.new("ScreenGui", plr.PlayerGui)
		ScreenGui.IgnoreGuiInset = true
		local frame = Instance.new("Frame", ScreenGui)
		frame.Size = UDim2.new(1,0,1,0)
		frame.Position = UDim2.new(0.5,0,0.5,0.5)
		frame.AnchorPoint = Vector2.new(0.5,0.5)
		frame.Transparency = 1



		for i=1, ConfigModule.Get().QTEcount do
			if not stop then


				local letters = {"A","D"}
				local choix = letters[math.random(#letters)]

				local bgimg = Hexagone:Clone()
				bgimg.Parent = frame
				bgimg.Size = UDim2.new(0.08, 0, 0.18, 0)
				bgimg.AnchorPoint = Vector2.new(0.5, 0.5)
				bgimg.Position = UDim2.new((math.random(0,100) / 100)/2, 0, (math.random(0,100) / 100)/2, 0)
				bgimg.ImageTransparency = 0.1

				local TextButton = Instance.new("TextButton", frame)
				TextButton.Size = UDim2.new(0.01, 0, 0.05, 0)
				TextButton.BackgroundColor3 = Color3.new(0, 0, 0)
				TextButton.BackgroundTransparency = 1
				TextButton.Position = bgimg.Position
				TextButton.AnchorPoint = Vector2.new(0.5, 0.5)
				TextButton.TextColor = BrickColor.new("Black")
				TextButton.RichText = true
				TextButton.TextScaled = true
				TextButton.Text = choix
				TextButton.Font = Enum.Font.Oswald
				TextButton.FontFace = Font.new(
					"rbxasset://fonts/families/Oswald.json",
					Enum.FontWeight.Bold,
					Enum.FontStyle.Normal
				)



				ts:Create(TextButton, info, {Size = UDim2.new(0.1, 0, 0.15, 0)}):Play()

				local UiCorner = Instance.new("UICorner", TextButton)

				TextButton.MouseButton1Click:Connect(function()
					Count += 1
					frame:FindFirstChild("TextButton"):Destroy()
				end)



				task.wait(1)

				choix = nil

				if frame:FindFirstChild("TextButton") then
					frame:FindFirstChild("TextButton"):Destroy()
				end

				if frame:FindFirstChild("Hexagone") then
					frame:FindFirstChild("Hexagone"):Destroy()
				end

				if i >= ConfigModule.Get().QTEcount then --succeded qte
					print(Count)
					Track:Stop()
					if Count <= ConfigModule.Get().QTEcount then
						FJDebounce = false
						LedgeVerificator()
						IsAtEdges()
						IdleTrack:Play()
						EnableAllBools()
						task.wait(1)
						Debounce2 = false
						CAN_JOINT_MOVE_ANIM = true
						return true
					else
						ToGround()
						LedgeVerificator()
						IsAtEdges()
						FJDebounce = false
						task.wait(1)
						Debounce2 = false
						return false
					end
				end
			end
		end
	end
end

Could it be an offset difference between your initial ledge grab, and your movement script?

Movements on the ledge are created by multiplying the current hrp like this; hrp = hrp.CFrame * CFrame.New(studs, 0, 0) so where ever my character is on the ledge it should be working

The issue was related to another function which didnt print when i needed to verify if it was the origin of the problem leading me to a false path

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.