Apparently, some line of code isn't giving an error, but It's not doing what it's supposed to do. This script is a local script in starter player scripts.

local UserInputService = game:GetService("UserInputService")
local LocalPlayer = game.Players.LocalPlayer
local waiting = false
local function CharacterAdded(char)
	Character = char
	Humanoid = char:WaitForChild("Humanoid")
end
 
if LocalPlayer.Character then
	CharacterAdded(LocalPlayer.Character)
end
 
LocalPlayer.CharacterAdded:connect(CharacterAdded)
UserInputService.JumpRequest:connect(function()
	if not Character or not Humanoid or not Character:IsDescendantOf(workspace) or Humanoid:GetState() == Enum.HumanoidStateType.Dead then
		return
	end
	if LocalPlayer.Box.Value == 0 then
		return
	end
	if not waiting then
		waiting = true
		LocalPlayer.Box.Value = 0
		local torso = Character:FindFirstChild("Torso")
		if torso then
			torso.Velocity = Vector3.new(torso.Velocity.X, Humanoid.JumpPower*0.9, torso.Velocity.Z)
		end
		wait(0.25)
		waiting = false
	end
end)

And this script here is a script inside a part.

local str = ""
local obj
script.Parent.MouseClick:Connect(function(hit)
	obj = hit
	str = hit.Name.."a"
	hit.Character.Torso.CFrame = (script.Parent.Parent.CFrame * CFrame.Angles(0,math.pi,0)) - Vector3.new(0,2.5,0)
	script.Parent.Parent.WeldConstraint.Part1 = hit.Character.Torso
	script.Parent.Parent.Anchored = false
	script.Parent.MaxActivationDistance = 0
	hit.Box.Value = 1
end)
script.Parent.Parent.Touched:Connect(function(hit)
	if hit.Name == "fail" then
		script.Parent.Parent.WeldConstraint.Part1 = nil
		obj.Box.Value = 0
	end	
	if script.Parent.Parent.WeldConstraint.Part1.Name == "Torso" then
		print("success")
		--This is where the error is, When the other event triggers, It sets the value to 0, but this doesnt set it to 1 again.
		--The success line does print.
		obj.Box.Value = 1
	end
end)

3 comments

0

Please check the 2nd script entirely.

0

Do you know where it stops running? If not, for your own convenience, print something each time something successfully happens so you can get a better understanding of where it stops. That will make it much easier to debug.

0

ok i might