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