When I try to require a modulescript from a server script in ServerScriptService, I get this strange error I’ve never gotten before:
The current thread cannot read 'UniqueId' (lacking capability RobloxScript)
The name of the modulescript is “UniqueId.”
I’ve already tried moving the modulescript to replicatedstorage, and requiring it from the command bar, but I still got the same error. Yes, the other script is a server script in serverscriptservice. Code:
local Players = game:GetService("Players")
local UniqueId = require(game.ServerScriptService.UniqueId)
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
char:SetAttribute("ID", UniqueId:GenerateID())
end)
end)
UniqueId:TagAllWithTag("GetsID")
The error originates on line two. Thanks for any help you can give!