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
 

Re: Writing a script for a group door;

Previous Thread :: Next Thread 
AndillasI is not online. AndillasI
Joined: 06 Apr 2011
Total Posts: 503
22 Dec 2011 02:18 PM
I know it's faulty and I know most of it is legitimate.
I think the problem is in the if statement. I don't know how to write connector lines at all.

door = script.Parent
(should there be a variable identifying the Player?)

   function touch
      if Player.new:IsInGroup "ID HERE" -- Put your group ID here
      door.Transparency = .8
      door.CanCollide = false
      wait(3) -- how long you want the door to be open
      door.Transparency = 0
      door.CanCollide = true
      end
   end
   [connector]
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
22 Dec 2011 02:24 PM
door = script.Parent
ID = <--Group ID

door.Touched:connect(function(Player)
PL = Player:GetPlayerFromCharacter(Player)
if PL:IsInGroup(ID)
door.Transparency = .8
door.CanCollide = false
wait(3) -- how long you want the door to be open
door.Transparency = 0
door.CanCollide = true
end
end)
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
22 Dec 2011 02:25 PM
Player does not exist.

function touch
should be
function touch()

[connector]
should be a legitimate connection line.
Report Abuse
tiger33333321 is not online. tiger33333321
Joined: 28 Mar 2010
Total Posts: 2115
22 Dec 2011 03:22 PM
door = script.Parent
ID = <--Group ID
door.Touched:connect(function(Player)
PL = p:GetPlayerFromCharacter(Player)
if PL:IsInGroup(ID)
door.Transparency = .8
door.CanCollide = false
wait(3) -- how long you want the door to be open
door.Transparency = 0
door.CanCollide = true
end
end)


The player is like the soul of your robloxian. The character is your body.
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
22 Dec 2011 03:28 PM
And yet everyone is ignoring the lack of 'then' after the condition.
Report Abuse
triston220 is not online. triston220
Joined: 08 Mar 2010
Total Posts: 1861
22 Dec 2011 03:41 PM

door = script.Parent
groupid = 123456
waittime = 3

function touched(part)
if part.Parent:findFirstChild("Humanoid") then
player = script.Parent
if player.IsInGroup(groupid) then
door.Transparency = .8
door.CanCollide = false
wait(waittime)
door.Transparency = 0
door.CanCollide = true
end
end
end
script.Parent.Touched:connect(touched)
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