Well, I'm Back. With Another Problem This Time I Have No Clue What I'm Doing. Each Time I'm Trying To Animate My Text It Disappears When it starts. I Have Music Playing In The Background And It Stops Too.
The Wierd Thing Is When It's Wrapped In A Function And It Disappears When Its In That Function
here it is its a local script remember This is It Wrapped In A Function
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AnimateUI = require(ReplicatedStorage:WaitForChild("TypeWriter"))
local label = script.Parent.DateAndTime
-- Load translator if game is localized
--AnimateUI.loadTranslator()
game.Workspace.Exploded.OnClientEvent:Connect(function()
game.Workspace.Camera.CameraType = Enum.CameraType.Scriptable
game.Workspace.Camera.CFrame = game.Workspace.Cam.CFrame
script.Parent.Visible = true
script.Parent.SM:Play()
local message1 = [[SECTOR-7 INCIDENT REPORT LOG <br/> INCIDENT DATE = REDACTED <br/> INCIDENT TIME = REDACTED]]
AnimateUI.typeWrite(label, message1, 0.1)
wait(5)
local message2 = [[Would You Like To Open File? Y/N <br/> Opening File... <br/> LOG REPORT:Nuke Launch,Reasons For Nuke = UNKOWN <br/> At EST = ????, <br/> Nuke Protocals Were Activated For Unknown Reasons <br/> at EST = ???? Nuke Was Spotted To Be Heading For ???? <br/> At EST = ???? Explosion Was Set Off By Impact. <br/> Lives And Deaths = Unknow <br/> Defense Workers Were Later Questioned For Why The Nuke Launched <br/> Workers:????&??? Were On Station During The Event Both Of Them Said They Got No Warning From The Systems. <br/> END LOG]]
AnimateUI.typeWrite(script.Parent.Info,message2,0.1)
wait(10)
script.Parent.SM:Pause()
game.Workspace.Camera.CameraType = Enum.CameraType.Custom
wait(30)
script.Parent.Visible = false
end)
This Is It Not Wrapped In A Function it works fine this way
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AnimateUI = require(ReplicatedStorage:WaitForChild("TypeWriter"))
local label = script.Parent.DateAndTime
game.Workspace.Camera.CameraType = Enum.CameraType.Scriptable
game.Workspace.Camera.CFrame = game.Workspace.Cam.CFrame
script.Parent.Visible = true
script.Parent.SM:Play()
local message1 = [[SECTOR-7 INCIDENT REPORT LOG <br/> INCIDENT DATE = REDACTED <br/> INCIDENT TIME = REDACTED]]
AnimateUI.typeWrite(label, message1, 0.1)
wait(5)
local message2 = [[Would You Like To Open File? Y/N <br/> Opening File... <br/> LOG REPORT:Nuke Launch,Reasons For Nuke = UNKOWN <br/> At EST = ????, <br/> Nuke Protocals Were Activated For Unknown Reasons <br/> at EST = ???? Nuke Was Spotted To Be Heading For ???? <br/> At EST = ???? Explosion Was Set Off By Impact. <br/> Lives And Deaths = Unknow <br/> Defense Workers Were Later Questioned For Why The Nuke Launched <br/> Workers:????&??? Were On Station During The Event Both Of Them Said They Got No Warning From The Systems. <br/> END LOG]]
AnimateUI.typeWrite(script.Parent.Info,message2,0.1)
wait(10)
script.Parent.SM:Pause()
game.Workspace.Camera.CameraType = Enum.CameraType.Custom
wait(30)
script.Parent.Visible = false
also, I am using the Roblox AnimateUI Module
local LocalizationService = game:GetService("LocalizationService")
local Players = game:GetService("Players")
local SOURCE_LOCALE = "en"
local translator = nil
local AnimateUI = {}
function AnimateUI.loadTranslator()
pcall(function()
translator = LocalizationService:GetTranslatorForPlayerAsync(Players.LocalPlayer)
end)
if not translator then
pcall(function()
translator = LocalizationService:GetTranslatorForLocaleAsync(SOURCE_LOCALE)
end)
end
end
function AnimateUI.typeWrite(guiObject, text, delayBetweenChars)
guiObject.Visible = true
guiObject.AutoLocalize = false
local displayText = text
-- Translate text if possible
if translator then
displayText = translator:Translate(guiObject, text)
end
-- Replace line break tags so grapheme loop will not miss those characters
displayText = displayText:gsub("<br%s*/>", "\n")
displayText:gsub("<[^<>]->", "")
-- Set translated/modified text on parent
guiObject.Text = displayText
local index = 0
for first, last in utf8.graphemes(displayText) do
index = index + 1
guiObject.MaxVisibleGraphemes = index
wait(delayBetweenChars)
end
end
return AnimateUI
Welp That's All The Scripts I Got PLEASE Look Over This And Correct Me If I'm Doing Anything Wrong.
