I am trying to make a script that when it detects that a player owns an item it sends them a purchase prompt, currently my Check1 boolean value is apparently not being picked up by my check script in serverscriptservice, they are both server sided so I don’t know what’s wrong. Currently I’ve tried switching it to remote events but I want this to be fully server sided so it is exploit proof.
The Line Sending
local function onPlayerAdded(player)
local _success, doesPlayerOwnAsset = pcall(MarketplaceService.PlayerOwnsAsset, MarketplaceService, player, ASSET_ID)
if doesPlayerOwnAsset then
print(player.Name .. " owns " .. ASSET_NAME)
game.ServerStorage.Check1 = true
print(
"test"
)
else
print(player.Name .. " doesn't own " .. ASSET_NAME)
Check = false
end
end
Players.PlayerAdded:Connect(onPlayerAdded)
This is printing that I do own the item meaning that check1 should be set to true, however it is not being found
The Line Receiving
while true do
wait(5)
print("ok")
function Check(player)
print("checking")
if CheckV == true then
MarketplaceService:PromptPurchase(player, ITEM_ID)
BindE:Fire()
print("read")
end
if CheckV2 == true then
MarketplaceService:PromptPurchase(player, ITEM_ID2)
end
if CheckV3 == true then
MarketplaceService:PromptPurchase(player, ITEM_ID3)
end
if CheckV and CheckV2 and CheckV3 == false then
print("tried")
player:Kick("You Do Not Own Any Items From The Event")
end
end
Check()
end
It’s saying its not even set to true, plus the kick script even when all of them are set to false is also not working, the script isn’t running no matter the value.