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

If someone bought my V.I.P. T-shirt, how would I make a V.I.P. Door work?

Asked by 10 years ago

Can you help me with this?

0
VIP T-shirts are deprecated. The recommended method is game passes http://wiki.roblox.com/index.php/Game_Pass Destrings 406 — 10y
0
Test for owning the item. GoldenPhysics 474 — 10y

3 answers

Log in to vote
0
Answered by
Mauvn 100
10 years ago

Here is the script i made :

-- Recommended: Place this in the VIP Door
----------------------------------------------------------------------- 
PassOrShirtID = 000000000 -- Change this to your asset/shirt/badge/pass ID
Door = script.Parent -- Change this to the door (if needed)
OpenTime = 1 -- Change how long you want the door open
Prompt = true -- true = if the player doesn't have the item, prompt a screen to let them buy it. false = kill the player.
-----------------------------------------------------------------------
-- Made by Maronics --


--Do not touch below--
Serv = game:GetService("BadgeService")
MServ = game:GetService("MarketplaceService")
if not _G.Players then
    _G.Players = {
        [PassOrShirtID] = {};
    }
    print("Players Created")
elseif not _G.Players[PassOrShirtID] then
    _G.Players[PassOrShirtID] = {};
    print("Players.Pass created")
end

Table = _G.Players[PassOrShirtID]

function CheckPlayer(player2)
    for i = 1,#Table do
        if Table[i] == player2 then
            return true
        end
    end
    return false
end

Door.Touched:connect(function(hit)
    if game.Players:GetPlayerFromCharacter(hit.Parent) then
        player = game.Players:GetPlayerFromCharacter(hit.Parent)
        if Serv:UserHasBadge(player.userId,PassOrShirtID) or CheckPlayer(player) then
            Door.CanCollide = false; Door.Transparency = 0.5;
            wait(OpenTime);
            Door.CanCollide = true; Door.Transparency = 0;
        else
            if Prompt then -- Maronics
                MServ:PromptPurchase(player,PassOrShirtID)
                h = player.Character:FindFirstChild("Humanoid")
                if h then h.WalkSpeed = 0 end
                local con;
                con = MServ.PromptPurchaseFinished:connect(function(ply,asset,purch)
                    if ply == player and asset == PassOrShirtID then
                        con:disconnect()
                        if purch then
                            if h then h.WalkSpeed = 16 end
                            table.insert(Table,player)
                        else
                            player.Character:BreakJoints()
                        end
                    end 
                end)
            else
                player.Character:BreakJoints()
            end
        end
    end
end)




















-- Made by Maronics

Hope it helped :)

Ad
Log in to vote
0
Answered by 10 years ago

Make a gamepass, then go to your inventory and configure the gamepass from there, sell it. Once your done look at the number id on the top of the page at the link of your game pass, examine your V.I.P door in roblox studio, you will find the id part inside it, view properties and enter the number id of the gamepass there. It's that simple. Hope I helped.

Log in to vote
0
Answered by 10 years ago

Suggestion for above, you can make the door teleport the player, so hackers don't hack into it you can add this instead of CanCollide and Transparency:

GoTo = 0,0,0 -- Set the 0,0,0 to the position you want the player to teleport.
part.Parent:MoveTo(GoTo) -- This might not work , I haven't tested this.
0
Oh and comment the error on this answer and i'll see if I can fix it. Operation_Meme 890 — 10y

Answer this question