This is not working as intended

Hey developers,

So I am using @Roblox_2049 Simple closed caption module, (link below) and I’m having issues requiring the model.

So I have copied the instructions on the devforum post and copied the code but it is not working, it’s saying the GUI (which the module is in) is not in PlayerGui. Here’s the script:

local ClosedCaptions = require(game.Players.LocalPlayer.PlayerGui.ClosedCaptions.CaptionModule)

game.ReplicatedStorage.LockedPath.OnClientEvent:Connect(function()
	ClosedCaptions:Caption("This path is locked!", 5)
end)

It’s the exact first line of code that is not working.

ClosedCaptions is not a valid member of PlayerGui "Players.TeamDreams123.PlayerGui" 

Thanks for your help! :heart:

(ps: the module is below)

I still need help with this, can anyone help me?

Did you parent ClosedCaptions inside StarterGui?

image
@NyrionDev

EDIT: Also yes, it is a local script, so it can call Game.Players.LocalPlayer

I suggest using WaitForChild("The name of the thing you are waiting for") before referencing that GUI.

It works, sorry for me being stupid, I haven’t gotten much sleep this week… :yawning_face:

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