Hi, I don’t think much context is needed for my situation. I have a boolean value that I am changing on the client, but :GetPropertyChangedSignal() is not firing when I first change it. I have seen things about boolValues not replicating to the server, but it doesn’t make sense because the function still fires when I change the boolValue in another part of my code. I’ve tried using boolValue.Changed event instead but it also made no difference. I have not yet tried firing remote events because it wouldn’t quite fit what I’m trying to do.
Here’s my script:
local function movingPartTouched()
if character:FindFirstChild("Humanoid") then
firstTouched.Value = true
connection:Disconnect()
AnimateScript.run.RunAnim.AnimationId = RunAnimId
AnimateScript.idle.Animation1.AnimationId = IdleAnimationId
AnimateScript.walk.WalkAnim.AnimationId = WalkAnimationId
humanoid.JumpPower = 0
humanoid.WalkSpeed = 1
local firstTween = TweenService:Create(movingPart, startTweenInfo, {Position = movingPart.Position + Vector3.new(0,-2,0)})
firstTween:Play()
firstTween.Completed:Wait()
print("Tween completed") --prints
tweenCompleted = true
jumping.Value = false --jumping.Value prints as false, but does not fire jumping:GetPropertySignalChanged()
inputConnection = UserInputService.JumpRequest:Connect(function()
print("input") --prints
jumping.Value = true --fires jumping:GetPropertyChangedSignal()
while task.wait() and tweenCompleted do
if not jumping.Value then return end
local tweenUpGoals = {Position = movingPart.Position + Vector3.new(0,.25,0)}
local tweenUp = TweenService:Create(movingPart, tweenInfo, tweenUpGoals)
if movingPart.Position.Y >= 11 then
print("player escaped the quicksand")
humanoid.WalkSpeed = defaultWalkSpeed
humanoid.JumpPower = defaultJumpPower
AnimateScript.run.RunAnim.AnimationId = defaultRun
AnimateScript.idle.Animation1.AnimationId = defaultIdle
AnimateScript.walk.WalkAnim.AnimationId = defaultRun
movingPart.Position = Vector3.new(movingPart.Position.X, 10.317, movingPart.Position.Z)
firstTouched.Value = false
return
end
tweenUp:Play()
print("value of jumping before tween is completed: " ..tostring(jumping.Value))
tweenUp.Completed:Wait()
print("tween completed")
upTweenCompleted = true
jumping.Value = false --this fires jumping:GetPropertyChangedSignal(), but changing it at the start of the script did not
print("value of jumping after tween: "..tostring(jumping.Value))
end
end)
jumping:GetPropertyChangedSignal("Value"):Connect(function()
print("jump value changed to: "..tostring(jumping.Value)) --prints when changed inside the .JumpRequest but does not print when jumping is changed at the start of the script.
while task.wait() and tweenCompleted and not jumping.Value do
if jumping.Value then return end
local tweenDownGoals = {Position = movingPart.Position + Vector3.new(0, -.5, 0)}
local tweenDown = TweenService:Create(movingPart, tweenInfo, tweenDownGoals)
tweenDown:Play()
tweenDown.Completed:Wait()
end
end)
end
end
connection = movingPart.Touched:Connect(movingPartTouched)
firstTouched:GetPropertyChangedSignal("Value"):Connect(function()
print("entered") --prints
if firstTouched.Value == false then
print("waiting for part to be touched")
jumping.Value = true
inputConnection:Disconnect()
connection = movingPart.Touched:Connect(movingPartTouched)
end
end)
I’ve been trying to debug but it doesn’t make any sense how the firstTouch boolValue I’m using fires everytime, while my jumping boolValue only fires for some parts. Any responses would be greatly appreciated.