I’m trying to make a script that gives the player the Plague Wormie hat if they own it on roblox, I am using a StarterCharacter and want only people who own the Plague Wormie to have it.
local ASSET_ID = 6203025104 local Players = game:GetService("Players") local MPS = game:GetService("MarketplaceService") local POS = MPS.PlayerOwnsAsset Players.PlayerAdded:Connect(function(player) local Humanoid = player.Character.Humanoid local ServerStorage = game:GetService("ServerStorage") local Hat = ServerStorage.Miscellaneous:WaitForChild("Plague Wormie"):Clone() local success, doesPlayerOwnAsset = pcall(POS, MPS, player, ASSET_ID) if doesPlayerOwnAsset then print("They own it!") --Hat.Parent = player.Character Humanoid:AddAccessory(Hat) else print("They don't own it!") end end)
This is my current code, but no matter what I search up or try it won’t give them the hat.
The script is located in Server Script Service
I get this error.