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

How to move a script from ReplicatedStorage to StarterPlayerScripts?

Hello my name is Nick and i want to do a gamepass wich is double jump so i want to use this script if a olayer owns the gamepass he can double jump but i dont know how please help me

PassId = 1234567890 --My gamepass ID game:GetService("Players").PlayerAdded:connect(function(Player) if game:GetService("GamePassService"):PlayerHasPass(Player, PassId) then --Here i want to put the script that makes the gamepass work but idk how end end)

1 answer

:PlayerHasPass() is deprecated, you cannot use it for new gamepasses. Use :UserOwnsGamePassAsync() instead.

This is a sample script of how to let the player get the GamePass GUI prompt.

PassId = 16578690

game:GetService("Players").PlayerAdded:Connect(function(player)
	game.MarketplaceService:PromptGamePassPurchase(player, PassId)
end)

This is a sample script of how to detect if the player owns a gamepass:

PassId = 16578690

game:GetService("Players").PlayerAdded:Connect(function(player)
	if game.MarketplaceService:UserOwnsGamePassAsync(player.UserId, PassId) then
		print(tostring(player.Name) .." owns the gamepass!")
	end
end)

1 comment

0

Oh okay but the main problem is how can i move a script from ReplicatedStorage to StarterPlayerScripts?

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