Shorten text in a script

Is there a better way to indent long text instead of having to scroll all the way to edit? If so, what is it?

part of a code from the script:

FlashlightClick.MouseHoverEnter:Connect(function()
	Description.Text = "The advanced flashlight helps you see better throughout the darkness in your vision. It can be used to temporarily blind or stun the monster to buy time to flee (not yet added). Although, the battery is very unstable. Meaning the light will die out much faster than the regular one. So use it carefully."	
end)

FlashlightClick.MouseHoverLeave:Connect(function()
	Description.Text = "Waiting for Item."
end)

I dont think thats possible sadly,

2 Likes

IG you could use a multiline string, then remove any new line characters from it?
(Multiline string starts with [[ and ends with ]]]
Alternatively, you could have a bunch of lines either in an array or just in a row, and concatenate them all together

e.g.

local Text = {
    "The quick brown fox ",
    "jumped over the ",
    "lazy dog! "
}

local Result = ""
for _, string in ipairs(Text) do
    Result ..= Result
end
print(Result)
2 Likes

I think it would be a good idea to store the long text in a variable.

local introduction  = "Hello World My Name is Ramsa."
local Text = script.Parent
Text.Text = introduction
1 Like

It doesnt make much of a difference. It isn’t really related to his problem ngl

I like both of these solutions, sad that it isn’t possible to indent them. Thanks for the advice!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.