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: Door that becomes a door of a specific team?

Previous Thread :: Next Thread 
SecretDAgent is not online. SecretDAgent
Joined: 28 Apr 2012
Total Posts: 46
14 Apr 2014 04:38 PM
Is it possible to have a door that is "neutral" at first, until a team member touches the door and it become a door for that specific team?
Report Abuse
HalfPrint is not online. HalfPrint
Joined: 01 Feb 2014
Total Posts: 26981
14 Apr 2014 04:39 PM
anything is possible
Report Abuse
SecretDAgent is not online. SecretDAgent
Joined: 28 Apr 2012
Total Posts: 46
14 Apr 2014 04:52 PM
bump
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
14 Apr 2014 05:00 PM
door = script.Parent
door_team = Instance.new("BrickColorValue", door).Value = BrickColor.Gray()
debounce= false

door.Touched:connect(function(hit)
if debounce == false then
debounce = true
local c = hit.Parent:FindFirstChild("Humanoid")
local p
if c then
p = game.Players:GetPlayerFromCharacter(hit.Parent)
door_team.Value = p.TeamColor
end
else
door.CanCollide = false
door.Transparency = 0.5
wait(3)
door.CanCollide = true
doot.Transparency = 1
end
end)

hiiiiii
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
14 Apr 2014 05:05 PM
Wait, no, let me correct it.

door = script.Parent
door_team = Instance.new("BrickColorValue", door).Value = BrickColor.Gray()
debounce= false
debounce2 = false

door.Touched:connect(function(hit)
local c = hit.Parent:FindFirstChild("Humanoid")
local p
if c then
p = game.Players:GetPlayerFromCharacter(hit.Parent)
end
if not c or debounce2 then return end

if debounce == false then
debounce = true
door_team.Value = p.TeamColor

elseif debounce and door_team.Value == p.TeamColor
debounce2 = true
door.CanCollide = false
door.Transparency = 0.5
wait(3)
door.CanCollide = true
door.Transparency = 1
debounce2 = false

end
end)


Try that
Report Abuse
SecretDAgent is not online. SecretDAgent
Joined: 28 Apr 2012
Total Posts: 46
14 Apr 2014 05:08 PM
Thanks! So I just name the brick "Door", right?
Report Abuse
SecretDAgent is not online. SecretDAgent
Joined: 28 Apr 2012
Total Posts: 46
14 Apr 2014 05:11 PM
Oh I found an error in the script for door_team.
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
14 Apr 2014 05:20 PM
I'll check it out in the studio
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
14 Apr 2014 05:23 PM
door = script.Parent
door_team = Instance.new("BrickColorValue", door)
door_team.Value = BrickColor.Gray()
debounce= false
debounce2 = false

door.Touched:connect(function(hit)
local c = hit.Parent:FindFirstChild("Humanoid")
local p
if c then
p = game.Players:GetPlayerFromCharacter(hit.Parent)
end
if not c or debounce2 then return end

if debounce == false then
debounce = true
door_team.Value = p.TeamColor

elseif debounce and door_team.Value == p.TeamColor then
debounce2 = true
door.CanCollide = false
door.Transparency = 0.5
wait(3)
door.CanCollide = true
door.Transparency = 0
debounce2 = false

end
end)


There you go, all fixed. Works quite nicely if I do say so myself, :-P
Report Abuse
SecretDAgent is not online. SecretDAgent
Joined: 28 Apr 2012
Total Posts: 46
14 Apr 2014 05:50 PM
THANK YOU SO MUCH! YOU DA MASTER OF SCRIPTING BRO! :D
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