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

How do you make a gamepass that gives you a weapon?

I want to give players who own my gamepass a special weapon to use in the game. How do I do this?

1 answer

✓ Accepted answer

Server script

local gamepassId = 123 --replace with the id of your gamepass

local specialWeapon = game:GetService("ServerStorage").SpecialWeapon --replace with the path to the weapon

game:GetService("Players").PlayerAdded:Connect(function(plr)
	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, gamepassId) then
		plr.CharacterAdded:Wait()
		specialWeapon:Clone().Parent = plr:WaitForChild("StarterGear")
		specialWeapon:Clone().Parent = plr:WaitForChild("Backpack")
	end
end)

1 comment

0

Ty so much :)

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