This is a follow up on an earlier question. Shoutout to AntoninFearless who helped me get the main function of it working. Thank you so much! You're a total life saver.
The main function of this script is to summon tools into a player's Backpack upon saying a command. For instance, saying "/town guard" gives the player tools associated with a Town Guard. Rinse and repeat for various different types of characters and their tools. This part works out perfectly and it's all good.
What I can't figure out how to do is add Game Pass compatibility to this script. As far as I know, the game pass service is outdated or something. I know that it has to do something with marketplace, but I haven't learned how all that works yet. I'm still a novice at scripting.
Btw, the tools are stored in a folder called "Tools" in ReplicatedStorage. The script copies them from there.
The script is written a bit differently in the game pass section, but it still works perfectly. The part of the script that limits the game pass section is just what needs to be patched.
Below is my current version of the script. The game pass block has -- in front of it so that it's not active yet and the Fairy command still works. To test it, replace the command name with whatever you want and names of the tools with the actual names of the tools.
Thanks in advance for the help!
function onChatted(msg, speaker)
local source = string.lower(speaker.Name)
msg = string.lower(msg)
if msg == "/town guard" then
local townguard1 = game.ReplicatedStorage.Tools:FindFirstChild("Knight's Emberblade")
local townguard2 = game.ReplicatedStorage.Tools:FindFirstChild("Knight's Poisonblade")
local townguard3 = game.ReplicatedStorage.Tools:FindFirstChild("Knight's Sparkblade")
townguard1:Clone().Parent = speaker.Backpack
townguard2:Clone().Parent = speaker.Backpack
townguard3:Clone().Parent = speaker.Backpack
elseif msg == "/aragin" then
local aragin1 = game.ReplicatedStorage.Tools:FindFirstChild("Aragin's Giga Hammer")
local aragin2 = game.ReplicatedStorage.Tools:FindFirstChild("Aragin's Rustic Arsenal")
local aragin3 = game.ReplicatedStorage.Tools:FindFirstChild("Aragin's Toxic Terrain")
aragin1:Clone().Parent = speaker.Backpack
aragin2:Clone().Parent = speaker.Backpack
aragin3:Clone().Parent = speaker.Backpack
end
end
game.Players.PlayerAdded:connect(function(player)
-- if Game:GetService("GamePassService"):PlayerHasPass(player, INSERT_GAMEPASS_ID_HERE) then
player.Chatted:connect(function(msg) onChatted(msg, player)
if msg == '/fairy' then
local fairy1 = game.ReplicatedStorage.Tools:FindFirstChild("Fairy's Apple")
local fairy2 = game.ReplicatedStorage.Tools:FindFirstChild("Fairy's Searing Wings")
local fairy3 = game.ReplicatedStorage.Tools:FindFirstChild("Fairy's Spoon")
fairy1:Clone().Parent = player.Backpack
fairy2:Clone().Parent = player.Backpack
fairy3:Clone().Parent = player.Backpack
end
end)
--end
end)
-- Replace "INSERT_GAMEPASS_ID_HERE" with a Game Pass ID.

1 comment
The gamepass might take time to load into your game, it will work in studio and not in the game it self. If your gamepass finally loads in and you see it in your game store and doesn't work, let me know