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 » Scripting Helpers
Home Search
 

What is wrong with my game pass door script?

Previous Thread :: Next Thread 
jackb1014 is not online. jackb1014
Joined: 13 May 2012
Total Posts: 20
30 Oct 2012 04:51 PM
function onTouched(hit)
if Game:GetService("GamePassService"):PlayerHasPass(Player, 96480229) then
game.Workspace.Door.Transparency = 0.5
game.Workspace.Door.CanCollide = false
wait(2)
game.Workspace.Door.Transparency = 0
game.Workspace.Door.CanCollide = true
else
local h = hit.Parent:findFirstChild("Humanoid")
if h~=nil then
h.Health = 0
end
end
end

script.Parent.Touched:connect(onTouched)

It won't let me go through the door when I try to go through. What have I done wrong? Please help!
Report Abuse
morganCarr is not online. morganCarr
Joined: 21 Sep 2010
Total Posts: 19179
30 Oct 2012 05:05 PM
[ Content Deleted ]
Report Abuse
triston220 is not online. triston220
Joined: 08 Mar 2010
Total Posts: 1861
30 Oct 2012 05:08 PM
Player isn't defined.

    function onTouched(hit)
    if hit.Parent:findFirstChild("Humanoid") then
    Player = game.Players[hit.Parent.Name]
    if Game:GetService("GamePassService"):PlayerHasPass(Player, 96480229) then
    game.Workspace.Door.Transparency = 0.5
    game.Workspace.Door.CanCollide = false
    wait(2)
    game.Workspace.Door.Transparency = 0
    game.Workspace.Door.CanCollide = true
    else
    local h = hit.Parent:findFirstChild("Humanoid")
    if h~=nil then
    h.Health = 0
    end
    end
    end
    end
    script.Parent.Touched:connect(onTouched)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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