Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my block not following close to it's parent?

Asked by 8 years ago
while true do
    if script.Parent.Parent.Torso == nil then
        wait(5)
    elseif script.Parent ~= nil and script.Parent.Parent.Torso ~= nil then
        wait(.000000000001)
        script.Parent.CFrame = CFrame.new(script.Parent.Parent.Torso.CFrame.X+5,script.Parent.Parent.Torso.CFrame.Y+2.5,script.Parent.CFrame.Z)
    else    
    --That means that it is in ServerStorage or something like that

    --Just here to catch the error
    end
end

This script is supposed to make the host block follow the host block's parent closely. But that is not happening, test the block here: Test Place Here

0
if script.Parent.Parent.Torso is nil, it's going to error out anyway. User#6546 35 — 8y
0
Do you get any errors? dragonkeeper467 453 — 8y
0
Change the Torso part to 'script.Parent.Parent:FindFirstChild("Torso")' or else it will error anyway. TheDeadlyPanther 2460 — 8y

Answer this question