Here are the problems that need to be fixed, that I don't know how to fix
Problem 1: The gamepass ID being mentioned in the script isn't working
And because of problem one, problem 2 and 3 happen.
Problem 2: HereComesTheMoney doesn't play
Problem 3: The message doesn't show up
I need help here ):
local id = 5131379 game.Players.PlayerAdded:connect(function(player) if game:GetService("GamePassService"):PlayerHasPass(player, id) then game.Workspace.HereComesTheMoney.Playing = true local message = Instance.new('Message', game.Workspace) -- Insert a new message in the Workspace. message.Text = "Someone in the server has the Infinite Rain Gamepass, Why did he/she buy it? Anyways it'll rain Robux forever." wait(10) message:Destroy() -- Remove the message after 10 seconds.f object = script.Parent if (object ~= nil) and (object ~= game.Workspace) then model = object backup = model:clone() -- Make the backup waitTime = 0.3 --Time to wait between regenerations wait(math.random(0, waitTime)) while true do wait(waitTime) -- Regen wait time model = backup:clone() model.Parent = game.Workspace model:makeJoints() end
There are a couple errors in your code here.
ROBLOX made some changes to their gamepass servers a while back, and as such they produced a superior method. UserOwnsGamePassAsync
should be used as it is the most recent and up-to-date. It is a function of MarketplaceService
. Here is a demo of the code:
game.Players.PlayerAdded:Connect(function(plr) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, gamepassId) then print("Player owns pass!") end)
A Message
is deprecated and should not be used. Instead, use a TextLabel
as it offers more options and isn't deprecated.
connect
is deprecated. You should be using Connect
instead.
It is not recommended to use the 2nd arguement of Instance.new
(deprecated & performance issues). Instead, you can set the parent by doing X.Parent = Y
.
:clone()
is deprecated. You should be using :Clone()
instead.
(EDIT REASON: didn't see :clone())