I keep getting the error attempt to index nil with ‘WaitForChild’ from this ModuleScript, located in ReplicatedStorage:
local module = {}
local players = game:GetService("Players")
local tween_service = game:GetService("TweenService")
local local_player = players.LocalPlayer
local frame = players.LocalPlayer:WaitForChild("PlayerGui")-- Here
local home = frame.frame.home
local info = TweenInfo.new(.5, Enum.EasingStyle.Exponential)
local quick = TweenInfo.new(.3, Enum.EasingStyle.Exponential)
local exe_storage = game.ReplicatedStorage.exe_storage
local transparency_module = require(exe_storage.transparency_module)
local home_group = transparency_module.CreateGroup(home.container:GetDescendants(), info)
local StarterGui = game:GetService("StarterGui")
function module:home_view(state, plr)
if state and not home.Visible then
home.Visible = true
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
home.ImageTransparency = 1
home.container.ImageTransparency = 1
home.container.scale.Scale = 1.2
--
tween_service:Create(home, info, {ImageTransparency = .5}):Play()
tween_service:Create(home.container, info, {ImageTransparency = .1}):Play()
tween_service:Create(home.container.scale, info, {Scale = 1}):Play()
home_group:FadeIn()
else
tween_service:Create(home, quick, {ImageTransparency = 1}):Play()
tween_service:Create(home.container, quick, {ImageTransparency = 1}):Play()
tween_service:Create(home.container.scale, quick, {Scale = 1.2}):Play()
home_group:FadeOut()
--
task.wait(.3)
--
home.Visible = false
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
end
end
return module
How would I fix this?