Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is my gamepass script not working even know there are no errors?[SOLVED]

I'm making a game pass that gives the player a sword if they have the game pass. For some reason the script was working fine at first, but now it doesn't work at all.

Here is my script

local serivce = game:GetService("MarketplaceService")
local id = 7905956
game.Players.PlayerAdded:Connect(function(player)
	if serivce:UserOwnsGamePassAsync(player.UserId,id) then
	local clone = game.ReplicatedStorage.GamepassStorage["Master Sword"]:Clone()
	clone.Parent = player.Backpack
	end
end)

1 answer

Your script seems to be fine. If you are not getting an error, are you sure you are running it in the correct script?

PlayerAdded does not work on the client plus cloning an item locally wouldn't replicate for everyone so you'll need to be using a Server Script. They are the scripts without the little man. It also needs to be done in ServerScriptService (or Workspace however its easier to maintain if you keep everything inside ServerScriptService).

If you have it in a server script and in the right area, you might not own the game pass you are trying to clone a weapon for.

This discussion is preserved as it was. New answers, comments, and votes are closed.