It never works and I don’t know why
speed coil gamepass
local MarketPlaceService = game:GetService(“MarketplaceService”)
local GamepassID = 95654024
game.Players.PlayerAdded:Connect(function(player)
if MarketPlaceService:UserOwnsGamePassAsync(player.UserId GamepassID) then
game.ServerStorage.SpeedCoil:Clone().Parent = player:WaitForChild(“Backpack”)
game.ServerStorage.SpeedCoil:Clone().Parent = player:WaitForChild(“StarterGear”)
end
end)
gravity coil gamepass
local MarketPlaceService = game:GetService(“MarketplaceService”)
local GamepassID = 95659937
game.Players.PlayerAdded:Connect(function(player)
if MarketPlaceService:UserOwnsGamePassAsync(player.UserId GamepassID) then
game.ServerStorage.SpeedCoil:Clone().Parent = player:WaitForChild(“Backpack”)
game.ServerStorage.SpeedCoil:Clone().Parent = player:WaitForChild(“StarterGear”)
end
end)
Also noticed that in our gravity coil gamepass, you cloned the SpeedCoil instance instead of a gravity coil. It also seems unnecessary to add the tool into StarterGear.
It looks like there are some syntax errors in the code you provided. Here’s the fixed version:
Copy code
local MarketPlaceService = game:GetService("MarketplaceService")
local GamepassID = 95654024
game.Players.PlayerAdded:Connect(function(player)
if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, GamepassID) then
game.ServerStorage.SpeedCoil:Clone().Parent = player:WaitForChild("Backpack")
game.ServerStorage.SpeedCoil:Clone().Parent = player:WaitForChild("StarterGear")
end
end)
-- gravity coil gamepass
local MarketPlaceService = game:GetService("MarketplaceService")
local GamepassID = 95659937
game.Players.PlayerAdded:Connect(function(player)
if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, GamepassID) then
game.ServerStorage.SpeedCoil:Clone().Parent = player:WaitForChild("Backpack")
game.ServerStorage.SpeedCoil:Clone().Parent = player:WaitForChild("StarterGear")
end
end)
There were a couple of issues with the code:
The MarketPlaceService:UserOwnsGamePassAsync function was being called with two arguments, player.UserId and GamepassID , but there was no comma between them.
The game.ServerStorage.SpeedCoil object was being cloned and added to both the player’s Backpack and StarterGear every time a player joined the game. It might be more appropriate to add different objects to the Backpack and StarterGear , depending on the gamepass that the player owns.