Animations not playing when animation tool gamepass is bought!

Heyo Devforum! I have created multiple animation gamepasses, but when you buy the gamepass, the animation does not play what so ever. I have no idea why this is happening as it works fine when it stays in the starter pack.

Tools:
image
image

This is in replicated storage

Here is the script that manages the gamepasses. This script is a local script inside the starter gui.

Script:

local player = game.Players.LocalPlayer
local marketplaceservice = game:GetService("MarketplaceService")
local dabgamepass = marketplaceservice:UserOwnsGamePassAsync(player.UserId, 12098002)
local supergamepass = marketplaceservice:UserOwnsGamePassAsync(player.UserId, 12159961)
local tposegamepass =  marketplaceservice:UserOwnsGamePassAsync(player.UserId, 12159974)

if dabgamepass then
	local dab = game.ReplicatedStorage.GamepassItems.Dab:Clone()
	dab.Parent = player.Backpack
end

if supergamepass then
	local super = game.ReplicatedStorage.GamepassItems.Superman:Clone()
	super.Parent = player.Backpack
end

if tposegamepass then
	local tpose = game.ReplicatedStorage.GamepassItems["T-Pose"]:Clone()
	tpose.Parent = player.Backpack
end

if player.Name == "Bombe0101" then
	local dab = game.ReplicatedStorage.GamepassItems.Dab:Clone()
	dab.Parent = player.Backpack
	local super = game.ReplicatedStorage.GamepassItems.Superman:Clone()
	super.Parent = player.Backpack
	local tpose = game.ReplicatedStorage.GamepassItems["T-Pose"]:Clone()
	tpose.Parent = player.Backpack
end

I have no idea why this happens. There are no errors, so I am not sure whether the problem is with the tools or the script. Please help!

I’m not 100% sure but if you try and clone a tool into the players backpack, the scripts will break and the tool will be practically useless. That’s why it will work in the Starterpack, but not after you clone them, and also why there are no errors. When I tried doing this the tool appeared in the backpack but didn’t work.

I think you can use Remote events to do this. Also, I would use the CharacterAdded event.

1 Like

Yeah, you can utilise remote events or you could handle it entirely on the server, hooked up by a CharacterAdded event to allow for the character’s backpack to load in.

Something like:
local player = game.Players.LocalPlayer
local marketplaceservice = game:GetService("MarketplaceService")
local dabgamepass = marketplaceservice:UserOwnsGamePassAsync(player.UserId, 12098002)

if dabgamepass then
   game.ReplicatedStorage.Your_Remote:FireServer(player)
end

game.ReplicatedStorage.Your_Remote.OnServerEvent:Connect(function(player)
    local dab = game.ReplicatedStorage.GamepassItems.Dab:Clone()
    dab.Parent = player.Backpack
end)

or:

local marketplaceservice = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local backpack = player:WaitForChild("Backpack")
		if marketplaceservice:UserOwnsGamePassAsync(player.UserId, 12098002) then
			local dab = game.ReplicatedStorage.GamepassItems.Dab:Clone()
			dab.Parent = backpack
		end
	end)
end)
1 Like