#Modules is not a valid member of ServerScriptService "ServerScriptService" help pls

1 messages · Page 1 of 1 (latest)

hollow acorn
#

so i was just messing around and learning stuff and i wanted to make a note in which i can change the text by a module script but it keeps telling me "Modules is not a valid member of ServerScriptService "ServerScriptService"" whenever i try to call i, when i dont do that the code works fine but when i do that it outputs that error and it just dosent work at all ill leave the code and a video of it below:

#

local script:

#

-- Services
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")

-- Variables
local localPlayer = Players.LocalPlayer
local playerGui = localPlayer:WaitForChild("PlayerGui")

local PaperGui = playerGui:WaitForChild("PaperGui")
local PaperText = PaperGui.Frame.TextLabel

local PaperTextModule = require(ServerScriptService.Modules.PaperTextModule)
--require(ServerScriptService:WaitForChild("Modules").PaperTextModule)
local tool = localPlayer.Backpack:WaitForChild("Paper")
print("Paper tool found")
PaperGui.Enabled = false

local character = localPlayer.Character or localPlayer.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")

-- Animations
local equipAnimation = Instance.new("Animation")
local IdleAnimation = Instance.new("Animation")
local UnequipAnimation = Instance.new("Animation")

equipAnimation.AnimationId = "rbxassetid://71001818620926"
IdleAnimation.AnimationId = "rbxassetid://75620053443899"
UnequipAnimation.AnimationId = "rbxassetid://79779200057827"

local equipTrack = animator:LoadAnimation(equipAnimation)
local IdleTrack = animator:LoadAnimation(IdleAnimation)
local UnequipTrack = animator:LoadAnimation(UnequipAnimation)

-- functions

local function EquipTool()
PaperGui.Enabled = true
equipTrack:Play()

equipTrack.Stopped:Once(function()
    print("anim finished")
    IdleTrack:Play()
end)

end

local function UnequipTool()
PaperGui.Enabled = false
IdleTrack:Stop()
equipTrack:Stop()
UnequipTrack:Play()
end

local function CreateText()
local TestText1 = PaperTextModule.TestNote1
PaperText.Text = TestText1
end

CreateText()

-- Main
tool.Equipped:Connect(EquipTool)
tool.Unequipped:Connect(UnequipTool)

#

ModuleScript:

#

local PaperTextNotes = {
TestNote1 = "Hey! this is a test paper, i dont really know what else to write here, have have you been? good? thats good? anyways see ya later broligator",

TestNote2 = "This is a test paper too because yes, dont judge me i want to make something myself without using ai for once and im so guilty about it",

TestNote3 = "test paper 3 because yes"

}

return PaperTextNotes

#

Script:

#

local clickDetector = script.Parent.ClickDetector
local paper = game:GetService("ServerStorage").Tools.Paper

clickDetector.MouseClick:Connect(function(player)
local tool = player.Backpack:FindFirstChild("Paper") or player.Character:FindFirstChild("Paper")
if tool then return end
local clone = paper:Clone()
clone.Parent = player.Backpack
end)

#

any help would be greatly appreciated!

kind swan
hollow acorn
#

Bro thank you 🙏

#

How would i get around this then

kind swan
#

move the module somewhere else. e.g ReplicatedStorage and require it from there instead as its accessible on the client