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 » Club Houses » Off Topic
Home Search
 

Re: Game Pass door

Previous Thread :: Next Thread 
minigamemakerr1 is not online. minigamemakerr1
Joined: 15 May 2011
Total Posts: 518
17 Jul 2014 02:26 AM
When i go though the Game pass door in my place, I end up teleporting @ the top of my lobby...Does anyone know why this i happonding and also the script was found on a wiki page, Because Game Pass door's are kinda new to me...

Report Abuse
widebrutus is not online. widebrutus
Joined: 03 Apr 2011
Total Posts: 21454
17 Jul 2014 02:26 AM
do we look like scripting helpers subforum
Report Abuse
theknightofblood is not online. theknightofblood
Joined: 15 Aug 2012
Total Posts: 9990
17 Jul 2014 02:26 AM
woo more idiots for OT to bash.

- obsession is an art - (add 25k posts to ocd)
Report Abuse
minigamemakerr1 is not online. minigamemakerr1
Joined: 15 May 2011
Total Posts: 518
17 Jul 2014 02:27 AM
idc
Report Abuse
Stuff1646 is not online. Stuff1646
Joined: 22 Dec 2012
Total Posts: 81
17 Jul 2014 02:29 AM
Have you tried this:
------------------------------------------
--| Stuff1646 demands better hammers XDD |--
------------------------------------------

-- 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


Create a vaule saying the Gamepassid
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
17 Jul 2014 02:29 AM
put
repeat until game:FindFirstChild("SubScript12")
on line 12
Report Abuse
minigamemakerr1 is not online. minigamemakerr1
Joined: 15 May 2011
Total Posts: 518
17 Jul 2014 02:30 AM
Sounds really good script, I'll try it..
Report Abuse
theknightofblood is not online. theknightofblood
Joined: 15 Aug 2012
Total Posts: 9990
17 Jul 2014 02:30 AM
what the hell, how'd a SC get in here

- obsession is an art - (add 25k posts to ocd)
Report Abuse
minigamemakerr1 is not online. minigamemakerr1
Joined: 15 May 2011
Total Posts: 518
17 Jul 2014 02:34 AM
@ Stuff1646
Doesn't work...
Report Abuse
Stuff1646 is not online. Stuff1646
Joined: 22 Dec 2012
Total Posts: 81
17 Jul 2014 02:35 AM
Try This:
Players = game:GetService("Players")
Lighting = game:GetService("Lighting")
GamePass = game:GetService("GamePassService")


PassId =

local debounce = false

script.Parent.Touched:connect(function(hit)
if hit.Parent:findFirstChild("Humanoid") and debounce == false then
debounce = true
player = Players:GetPlayerFromCharacter(hit.Parent)
if GamePass:PlayerHasPass(player, PassId) then
script.Parent.Transparency = .5
script.Parent.CanCollide = false
wait(5)
script.Parent.Transparency = 0
script.Parent.CanCollide = true
else
player.Character:BreakJoints()
end
wait(2)
debounce = false
end
end)

Above should work has i used it before...
Report Abuse
minigamemakerr1 is not online. minigamemakerr1
Joined: 15 May 2011
Total Posts: 518
17 Jul 2014 02:38 AM
HURRAY !!
It works...The door opens and if you hav'nt got the pass then it kills the player !

Thank You !

Report Abuse
Stuff1646 is not online. Stuff1646
Joined: 22 Dec 2012
Total Posts: 81
17 Jul 2014 02:38 AM
Happy to help ^^
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » Off Topic
   
 
   
  • 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