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

My Gamepass that changes your avatar + gives you my other gamepasses doesn't work?

I have tried to make a gamepad which sells all my other game passes for a discount along with giving your avatar something.

Here is my script so far, please let me know where I made a mistake!

local gamepassId = 12077225 --- whatever your gamepass id is local mps = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(plr) if mps:UserOwnsGamePassAsync(plr.UserId,gamepassId)then plr.CharacterAdded:Connect(function(char) plr.Character.Humanoid.JumpPower = 70 wait(1) end) end end)

local gamepassId = 12077193 --- whatever your gamepass id is local mps = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(plr) if mps:UserOwnsGamePassAsync(plr.UserId,gamepassId)then plr.CharacterAdded:Connect(function(char) plr.Character.Humanoid.WalkSpeed = 25 wait(1) end) end end)

game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) local trail = game.ServerStorage.Trail:Clone() trail.Parent = char.Head local attachment0 = Instance.new("Attachment",char.Head) attachment0.Name = "TrailAttachment0" local attachment1 = Instance.new("Attachment",char.HumanoidRootPart) attachment1.Name = "TrailAttachment1" trail.Attachment0 = attachment0 trail.Attachment1 = attachment1 end) end)

game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) wait(2) local trail = char.Head.Trail local MarketPlaceService = game:GetService("MarketplaceService") local UserId = player.UserId local PlayerBoughtThisGamepass = MarketPlaceService:UserOwnsGamePassAsync(UserId, 12077246) -- Change to gamepassid

	if PlayerBoughtThisGamepass then
		trail.Enabled = true
		trail.Lifetime = 5
	else
		trail.Enabled = false
	end
end)

end)

local gamepassId = 11723197 local service = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(player) if (service:UserOwnsGamePassAsync(player.UserId, gamepassId)) then local tags = { { TagText = "VIP", -- Tag TagColor = Color3.fromRGB(255, 255, 0) -- VIP Color } } local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService) local speaker = nil while speaker == nil do speaker = ChatService:GetSpeaker(player.Name) if speaker ~= nil then break end wait(0.01) end speaker:SetExtraData("Tags",tags) speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 0)) -- Text Color end end)

local MarketPlaceService = game:GetService("MarketplaceService") local GamepassID = 12077213 -- The Gamepass ID

game.Players.PlayerAdded:Connect(function(player)

if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, GamepassID) then
	
	game.ServerStorage.ClassicSword:Clone().Parent = player:WaitForChild("Backpack")
	game.ServerStorage.ClassicSword:Clone().Parent = player:WaitForChild("StarterGear")
end

end)

Player.Hat = 138932314

2 comments

0

please use code blocks properly

0

I do not know how to sorry. I am very new here! I will try!

1 answer

local gamepassId = 12077225 --- whatever your gamepass id is
local mps = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(plr)
	if mps:UserOwnsGamePassAsync(plr.UserId,gamepassId)then
		plr.CharacterAdded:Connect(function(char)
			plr.Character.Humanoid.JumpPower = 70
			wait(1)
		end)
	end
end)

local gamepassId = 12077193 --- whatever your gamepass id is
local mps = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(plr)
	if mps:UserOwnsGamePassAsync(plr.UserId,gamepassId)then
		plr.CharacterAdded:Connect(function(char)
			plr.Character.Humanoid.WalkSpeed = 25
			wait(1)
		end)
	end
end)

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local trail = game.ServerStorage.Trail:Clone()
		trail.Parent = char.Head
		local attachment0 = Instance.new("Attachment",char.Head)
		attachment0.Name = "TrailAttachment0"
		local attachment1 = Instance.new("Attachment",char.HumanoidRootPart)
		attachment1.Name = "TrailAttachment1"
		trail.Attachment0 = attachment0
		trail.Attachment1 = attachment1
	end)
end)


game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		wait(2)
		local trail = char.Head.Trail
		local MarketPlaceService = game:GetService("MarketplaceService")
		local UserId = player.UserId
		local PlayerBoughtThisGamepass = MarketPlaceService:UserOwnsGamePassAsync(UserId, 12077246) -- Change to gamepassid
		
		if PlayerBoughtThisGamepass then
			trail.Enabled = true
			trail.Lifetime = 5
		else
			trail.Enabled = false
		end
	end)
end)

local gamepassId = 11723197
local service = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(player)
	if (service:UserOwnsGamePassAsync(player.UserId, gamepassId)) then
		local tags = {
			{
				TagText = "VIP", -- Tag
				TagColor = Color3.fromRGB(255, 255, 0) -- VIP Color
			}
		}
		local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)
		local speaker = nil
		while speaker == nil do
			speaker = ChatService:GetSpeaker(player.Name)
			if speaker ~= nil then break end
			wait(0.01)
		end
		speaker:SetExtraData("Tags",tags)
		speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 0)) -- Text Color
	end
end)

local MarketPlaceService = game:GetService("MarketplaceService")
local GamepassID = 12077213 -- The Gamepass ID

game.Players.PlayerAdded:Connect(function(player)
	
	if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, GamepassID) then
		
		game.ServerStorage.ClassicSword:Clone().Parent = player:WaitForChild("Backpack")
		game.ServerStorage.ClassicSword:Clone().Parent = player:WaitForChild("StarterGear")
	end
end)

Player.Hat = 138932314

1 comment

0

That is the peice of code I have!

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