Hey! I’m making a loading screen, but I have an issue where a function I wrote in a ModuleScript
located in ReplicatedStorage
just isn’t working. I made a print()
command to try and see if it was the function, but it was still called. I think the most liable culprit would either be the arguments I give when firing the function, or some kind of overarching behavior in the ScreenGui I’m using. Here’s the ModuleScript's
code:
local UIModule = {}
local TweenService = game:GetService("TweenService")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
--FUNCTIONS FOR THE MAIN MENU/BASICS
function UIModule.TweenTextTransparency(subject, numberGoal:number, timeTween:number)
local Anim = TweenService:Create(subject, TweenInfo.new(timeTween), {TextTransparency = numberGoal})
Anim:Play()
print("playing" .. subject.Name .. " TextTransparency Tween")
end
return UIModule
And here’s my LocalScript’s code, which is located in a Frame that parents the textlabel I’m referencing in the script:
local UIModule = require(game:GetService("ReplicatedStorage").Modules.UIModule)
local MainFrame = game:GetService("StarterGui"):WaitForChild("MainMenu"):WaitForChild("MainFrame")
local TweenService = game:GetService("TweenService")
local PlayButton = MainFrame:WaitForChild("Play")
local CreditText = MainFrame:WaitForChild("GameBY")
local MainTitle = MainFrame:WaitForChild("Title")
--START-UP
task.wait(2)
UIModule.TweenTextTransparency(CreditText, 0, 1)
Thank you for your time.