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: Door Script

Previous Thread :: Next Thread 
hypnotictoad is not online. hypnotictoad
Joined: 17 Jul 2011
Total Posts: 12
01 Sep 2016 06:20 AM
Hi,

I'm coding for a door that 'opens' (invisible/can't collide) and 'closes' (visible/can collide) when clicked. I'm basing it on SkeleLordGamer's script on YouTube. However, when I'm testing it, it doesn't seem to open at all. Please could you help me? CLICK is an invisible brick where the door is which I want to be clicked to open and close the door. CLICK contains 'ClickDetector' and 'Script'. Part1 and Part2 are the parts of the door which should be changed when CLICK is clicked. CLICK, Part1 and Part2 are contained within in a group called 'DOOR'.


This is what the 'Script' contains:
___________________________

local Wood = true

local part1 = script.Parent.Parent.Part1

######################################################################################################### part1.CanCollide = true
part2.Transparency = 0.3
part2.CanCollide = true
end

local function off()
Wood = false
part1.Transparency = 1
part1.CanCollide = false
part2.Transparency = 1
part2.CanCollide = false
end

local function OnClicked()
if Wood == true then off() else on() end
end

script.Parent.ClickDetector.MouseClick:conncect (OnClicked)
on()
________________________

Thanks in advance
Report Abuse
hypnotictoad is not online. hypnotictoad
Joined: 17 Jul 2011
Total Posts: 12
01 Sep 2016 06:21 AM
#######################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
Report Abuse
hypnotictoad is not online. hypnotictoad
Joined: 17 Jul 2011
Total Posts: 12
01 Sep 2016 06:21 AM
######################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
01 Sep 2016 06:24 AM
Is part2 defined?
Report Abuse
hypnotictoad is not online. hypnotictoad
Joined: 17 Jul 2011
Total Posts: 12
01 Sep 2016 06:33 AM
ROBLOX safe chat isn't letting you see all of the script, but part2 is defined.
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
01 Sep 2016 07:01 AM
'script.Parent.ClickDetector.MouseClick:conncect (OnClicked)'
'conncect'
Report Abuse
hypnotictoad is not online. hypnotictoad
Joined: 17 Jul 2011
Total Posts: 12
01 Sep 2016 07:18 AM
Thanks! I changed 'conncect' to 'connect', but it is still not doing anything.
Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
01 Sep 2016 07:37 AM
Try changing this, "if Wood == true then off() else on() end"
To,


if Wood then
off()
else
on()
end


𝐉𝐮𝐬𝐭 𝐬𝐨𝐦𝐞 𝟏𝟒 𝐲𝐞𝐚𝐫 𝐨𝐥𝐝
Report Abuse
hypnotictoad is not online. hypnotictoad
Joined: 17 Jul 2011
Total Posts: 12
01 Sep 2016 07:44 AM
Thanks for the response! I know it seems like I'm being really obstinate, but that didn't change anything either.
Report Abuse
hypnotictoad is not online. hypnotictoad
Joined: 17 Jul 2011
Total Posts: 12
01 Sep 2016 10:39 AM
I have no idea what to do.
Report Abuse
hypnotictoad is not online. hypnotictoad
Joined: 17 Jul 2011
Total Posts: 12
01 Sep 2016 10:46 AM
___FIXED___

After 'function on()', I used 'Wood = false' by accident. It should have been 'Wood = true'.

Thanks for your help guys.
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