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

How do I make a 'story-mode talking text'?

Asked by 5 years ago

I got an idea where a talking text will appear when you go to the right position but only once. Just like in the camping game but I ain't making a camping game, a roses-like instead.

2 answers

Log in to vote
1
Answered by 5 years ago

you could have a typewriter function which types the text,using string.sub(), so lets say you want the script to activate 10 seconds into the game, we need a function to type the text and make it wait 10 seconds. place this script into the text UI

local function TypeText(Txt, TimeToType, UI) -- We Use "TimeToType" to see how fast the typewriter will be (e.g will it take 5 seconds, 10 seconds etc) and "UI" to show which UI it will type on
    local TextLength = string.len(Txt) -- Find How Long The Text Is
    local TimeToWait = TextLength / TimeToType -- Divide 'TextLength' By how long it takes to get how long each character of the sentence will take to be typed.
    if not UI:IsA("TextLabel") or not UI:IsA("TextBox") or not UI:IsA("TextButton") then
        error("Script Error: UI is Not A TextLabel, TextButton, Or TextBox")
    elseif UI:IsA("TextLabel") or UI:IsA("TextBox") or UI:IsA("TextButton") then
        for textCount = 1, TextLength, 1 do
            UI.Text = string.sub(Txt, 1, i)
            wait(TimeToWait)
        end
        UI.Text = " "
    end
end

wait(10)
TypeTxt("Welcome To PlaceName!", 3, script.Parent)

---[ OR SOMETHING LIKE A SHOP ] ---

local Distance = (workspace.ShopPart.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude

repeat
    wait()
until Distance < 30
TypeTxt("Welcome To The Shop!", 2.5, game.StarterGui.ShopTextThingy)
0
Upvote for devotion Ziffixture 6913 — 5y
0
he is not asking for that & that is not the best way to do a typewrite script, the best way for a typewrite script is with a module script NSMascot 113 — 5y
Ad
Log in to vote
0
Answered by
NSMascot 113
5 years ago
Edited 5 years ago

maybe ontouch

put this script into the part you want the players to touch

script.Parent.Touched:Connect(function() -- function
--make text appear here
script.Disabled = true -- this makes sure the script won't activate again
end) -- end
0
Please tell me how to put the script as I am just a game builder but not scripter Hitormiss1121 -5 — 5y
0
in the explorer, click on the plus button when your mouse is hovering over the part you want to add a script to, then in the search box add a script NSMascot 113 — 5y
0
The script won't work for me, sorry. Hitormiss1121 -5 — 5y
0
Sorry :( NSMascot 113 — 5y

Answer this question