Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Why won Force Teleport work?

Asked by
Rurith 10
9 years ago
local get=function(d) return game:GetService(d) end;
local ms=get'MarketplaceService';

local game_dat=ms:GetProductInfo(game.PlaceId);
local prev_shout="";

local p=print;


while wait() do
    local suc,res=pcall(function() return ms:GetProductInfo(173676511) end);
    if not suc then
        p("[NOTICE] Unable to perform actions. Is MarketplaceService down?");
    else
        local dat;
        if type(res)=='string' then
            dat=get'HttpService':JSONDecode(dat).Description;
        elseif type(res)=='table' then
            dat=res.Description;
        else
            p("Bad response");
        end;
        if type(dat)=='string' then
            if dat:sub(0,20)==prev_shout then
                p"Already shouted";
            else
                prev_shout=dat:sub(0,20)
                coroutine.wrap(function()
                    local msg=Instance.new("Message",Workspace);
                    game:GetService("TeleportService"):Teleport("!\n\n"..dat, player)
                end)();
            end;
        else
            print'dat nil'
        end;
    end
    end

The purpose of the script is when I put a ID of a place in the desc of the model, it should teleport every person to that game/ID. But, it wont even wrok? Can you guys PLEASE help me fix it!

Answer this question