I am trying to make a ladder that you can grab and move.
In studio I pick up the ladder, move it to my desired location, then drop it, and it stays where I place it.
In game I pick up the ladder, move it to the same location, drop it, and moments later it has me moving it again.
In order to pick up the ladder, you hold the E button or hold click on the proximity prompt for 1 second, then it will hover in front of you until you decide to hold the E button on it again. The two scripts below are to pick it up and drop it. When it is picked up, a loop runs and if the proximity prompt is triggered again, both scripts run, but the Carry one passes on because the carrying value isn’t false, and the PutDown script runs, and sets carrying to false, and then the Carry script breaks the loop from constantly checking if the value comes down to if it’s false or not, then putting down the ladder in the same position that you left it in where it last hovered.
SCRIPTS:
“Carry” Server-Sided Script
script.Parent.Triggered:Connect(function(plr)
if script.Parent.Carrying.Value == false then
wait(1)
script.Parent.ActionText = "Put Down"
script.Parent.Carrying.Value = true
local char = plr.Character
local offset = Vector3.new(0,0,-7)
while wait(.035) do
script.Parent.Parent.CFrame = char.PrimaryPart.CFrame*CFrame.new(offset)
script.Parent.TimeInAir.Value += 1
if script.Parent.Carrying.Value == false then
break
end
end
end
end)
“PutDown” Server-sided Script
script.Parent.Triggered:Connect(function(plr)
if script.Parent.Carrying.Value == true then
script.Parent.Carrying.Value = false
script.Parent.ActionText = "Carry"
end
end)
No errors, game has been published and retested multiple times, servers shutdown, rejoined all that. Can someone help me? I have looked everywhere on the devforum, maybe not hard enough, but I couldn’t find anything similar to my issue!