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

won't move part anymore part just floats?? :/

Asked by 3 years ago

the part is just stuck in the air, it won't fall??

local MainPart = game.Workspace.Part
local TextBox = script.Parent

local function CheckIfCompatible(txt)
    local max = 10

    if string.len(txt) >= max then
        return false
    end

    if string.len(txt) <= max then
        return true
    end
end

TextBox.FocusLost:Connect(function()

    local texts = ""

    local text = TextBox.Text
    local Compatible = CheckIfCompatible(text)

    if Compatible then
        MainPart.Position = Vector3.new(0, text, 0)
        texts = "Moved Part"
    else
        texts = "Too long to read."
    end

    script.Parent.Text = tostring(texts)
end)

2 answers

Log in to vote
1
Answered by
zadobyte 692 Moderation Voter
3 years ago

Did you make sure the part wasn't anchored?

Ad
Log in to vote
1
Answered by
DemGame 271 Moderation Voter
3 years ago

Put this into your code:

MainPart.Anchored = false

Answer this question