Hello!
I’m trying to get a Module Script but for some reason i’m getting an red underline, even if i typed everything correctly, and i made sure the location of the module is correct (it even autocompleted itself)
Here’s the script:
local BarrierFolder = script.Parent
for _, Barrier in pairs(BarrierFolder:GetDescendants()) do
if Barrier:IsA("BasePart") then
Barrier.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild('Humanoid') then
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
local Character = Player.Character or Player.CharacterAdded:Wait()
local PlayerGui = Player.PlayerGui
local DialogueModule = require(PlayerGui.Dialogue:WaitForChild('DialogueModule'))
DialogueModule.Dialog('That area is restricted')
end
end)
end
end
(the underline is below “require(PlayerGui.Dialogue:WaitForChild(‘DialogueModule’))”)
Thanks for the help