generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Please help [GAMEPASS DOOR]

Previous Thread :: Next Thread 
Dbaffled is not online. Dbaffled
Joined: 15 Jul 2015
Total Posts: 743
16 Aug 2015 12:26 AM
IDK how to make it be like "would you like to by the VIP lounge gamepass" when they try going to the VIP door, how do i make it do that?

[I CANT SCRIPT LUA]
Report Abuse
teamkilled is not online. teamkilled
Joined: 14 Apr 2013
Total Posts: 1748
16 Aug 2015 12:27 AM
http://wiki.roblox.com/index.php?title=PromptPurchase
Report Abuse
Dbaffled is not online. Dbaffled
Joined: 15 Jul 2015
Total Posts: 743
16 Aug 2015 12:29 AM
--------------------
--| WaitForChild |--
--------------------

-- Waits for parent.child to exist, then returns it
local function WaitForChild(parent, childName)
assert(parent, "ERROR: WaitForChild: parent is nil")
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end

-----------------
--| Variables |--
-----------------

local GamePassService = Game:GetService('GamePassService')
local PlayersService = Game:GetService('Players')

local VipDoor = script.Parent

local GamePassIdObject = WaitForChild(script, 'GamePassId')

local JustTouched = {}

-----------------
--| Functions |--
-----------------

-- Finds out which side the player is on and teleports them to the other
local function TeleportToOtherSide(character, hitPart)
local bottomOfDoor = VipDoor.CFrame.p - Vector3.new(0, VipDoor.Size.Y / 2, 0)
local inFrontOfDoor = bottomOfDoor + VipDoor.CFrame.lookVector * 3
local behindDoor = bottomOfDoor - VipDoor.CFrame.lookVector * 3

local distanceToFront = (inFrontOfDoor - hitPart.Position).magnitude
local distanceToBack = (behindDoor - hitPart.Position).magnitude
if distanceToFront < distanceToBack then
character:MoveTo(behindDoor)
else
character:MoveTo(inFrontOfDoor)
end
end

-- When a player with the game pass touches the door, teleport them to the other side
local function OnTouched(otherPart)
if otherPart and otherPart.Parent and otherPart.Parent:FindFirstChild('Humanoid') then
local player = PlayersService:GetPlayerFromCharacter(otherPart.Parent)
if player and not JustTouched[player] then
JustTouched[player] = time()
if GamePassService:PlayerHasPass(player, GamePassIdObject.Value) then
TeleportToOtherSide(player.Character, otherPart)
end
end
end
end

-- Removes old entries in JustTouched
local function RemoveOldTouches()
for player, touchTime in pairs(JustTouched) do
if time() > touchTime + 0.3 then
JustTouched[player] = nil
end
end
end

--------------------
--| Script Logic |--
--------------------

VipDoor.Touched:connect(OnTouched)

while true do
RemoveOldTouches()
wait(1/30)
end

id = 92997034
function onTouch(hit)
if hit.Parent.Humanoid ~= nil then
local player = game.Players:getPlayerFromCharacter(hit.Parent)
game:GetService("MarketplaceService"):PromptPurchase(player, id)
end
end
script.Parent.Touched:connect(onTouched)



didnt work
Report Abuse
teamkilled is not online. teamkilled
Joined: 14 Apr 2013
Total Posts: 1748
16 Aug 2015 12:29 AM
where did you get that from
Report Abuse
Dbaffled is not online. Dbaffled
Joined: 15 Jul 2015
Total Posts: 743
16 Aug 2015 12:30 AM
thats how to do it right? ITS NOT WORKING :(

Report Abuse
teamkilled is not online. teamkilled
Joined: 14 Apr 2013
Total Posts: 1748
16 Aug 2015 12:31 AM
what's the error
Report Abuse
Dbaffled is not online. Dbaffled
Joined: 15 Jul 2015
Total Posts: 743
16 Aug 2015 12:32 AM
idk how to find it here wtf

i script python and js

not lua
Report Abuse
teamkilled is not online. teamkilled
Joined: 14 Apr 2013
Total Posts: 1748
16 Aug 2015 12:33 AM
Studio>View>Output
then look for the red error
Report Abuse
Dbaffled is not online. Dbaffled
Joined: 15 Jul 2015
Total Posts: 743
16 Aug 2015 12:35 AM
it doesnt say one x_x

how much would someone on this forum charge for a VIP door that once you buy a gamepass, you can go through. also if you dont have it, and you try going through, it prompts you
Report Abuse
teamkilled is not online. teamkilled
Joined: 14 Apr 2013
Total Posts: 1748
16 Aug 2015 12:36 AM
well if there's no error its obviously not working
and idk if anyone on this forum does script for pay, not me
Report Abuse
Dbaffled is not online. Dbaffled
Joined: 15 Jul 2015
Total Posts: 743
16 Aug 2015 12:37 AM
-____________-

teamkilled can you help me out :( i helped you out when you needed that thing for auto promotion or w/e so i added you to a chat with alex

-_-

qq

Report Abuse
teamkilled is not online. teamkilled
Joined: 14 Apr 2013
Total Posts: 1748
16 Aug 2015 12:38 AM
oh just realized who you are
Report Abuse
Dbaffled is not online. Dbaffled
Joined: 15 Jul 2015
Total Posts: 743
16 Aug 2015 12:38 AM
can you halp b4 i cry and smash my laptop
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
16 Aug 2015 12:39 AM
OP asked this in C&G >________>
Report Abuse
Dbaffled is not online. Dbaffled
Joined: 15 Jul 2015
Total Posts: 743
16 Aug 2015 12:40 AM
reoccuring shut the hell up idiot
Report Abuse
Dbaffled is not online. Dbaffled
Joined: 15 Jul 2015
Total Posts: 743
16 Aug 2015 12:42 AM
plz tked
Report Abuse
76km is not online. 76km
Joined: 14 Aug 2015
Total Posts: 5455
16 Aug 2015 12:46 AM
okay we wont read blobs k thx bai

wiki.roblox.com
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image