Heres the script with the problem (It's a script in ServerScriptService)
--// Also I want you to know that I'm very new to the marketplace service, and I only read one article.
--// Services
local market = game:GetService("MarketplaceService")
--// Variables
local speed_ID = 5659840164
local playerOwnsAsset = market.PlayerOwnsAsset
--// 2x gamepass
game.Players.PlayerAdded:Connect(function(player)
local success, PlayerOwns2x = pcall(playerOwnsAsset, market, speed_ID, player)
if PlayerOwns2x then
print(player.Name.. " Owns 2x speed")
local char = player.Character
local hum = char.Humanoid
if hum ~= nil then
print(player.Name.. " 2x speed enabled.")
hum.WalkSpeed = hum.WalkSpeed * 2
end
elseif not PlayerOwns2x then
print(player.Name.. " Doesn't own 2x speed")
end
end)
I think getting the character is whats causing the problem. Can someone help me with this?

1 comment
Oh okay, I'll test it.