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: gate opener(?) script.

Previous Thread :: Next Thread 
darknaster is not online. darknaster
Joined: 26 Mar 2013
Total Posts: 269
25 Jun 2016 02:21 PM
Hello scripters that know how to script better than me, I was curious as to whether or not someone knew a script that would work to open a gate by pressing a button.

Link- https://www.roblox.com/games/440137802/Fort-WIP-10-completed

as you can see, the gate after the bridge needs to be opened but I want the people to press a button in order to do so, I was wondering if anybody could make help me out on how to script it.

Any help would be appreciated, thanks.


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
25 Jun 2016 02:23 PM
learn how to use CFrame


Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
25 Jun 2016 02:24 PM
It depends if it's constructed good enough.

Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo
Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
25 Jun 2016 02:27 PM
Do you want it to open by the sides or do you want it to move up.

Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo
Report Abuse
darknaster is not online. darknaster
Joined: 26 Mar 2013
Total Posts: 269
25 Jun 2016 02:27 PM
@handssome if you look at the gate I feel it i constructed fine, I can group it all into one model and place it in a game for you can see


Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
25 Jun 2016 02:29 PM
I meant if the gate was constructed in a way which makes it possible to open.

Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo
Report Abuse
darknaster is not online. darknaster
Joined: 26 Mar 2013
Total Posts: 269
25 Jun 2016 02:29 PM
@handsome can you look at it if you have time?


Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
25 Jun 2016 02:31 PM
I'm looking at it right now.

You could just do the easiest method by lifting up the gate. But then you could do a harder version which is to move it by the sides.

Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo
Report Abuse
darknaster is not online. darknaster
Joined: 26 Mar 2013
Total Posts: 269
25 Jun 2016 02:36 PM
yes, but I don't have knowledge of the lua language when it comes to doing things like this. I just need help in which way is easier to do


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
25 Jun 2016 02:37 PM
button.ClickDetector.MouseClick:conect(function(player)
--cframe door
end)


Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
25 Jun 2016 02:44 PM
connect*

Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo
Report Abuse
darknaster is not online. darknaster
Joined: 26 Mar 2013
Total Posts: 269
25 Jun 2016 02:54 PM
@TimeTicks , button.ClickDetector.MouseClick:connect(function(player)
--cframe door
end)

I don't understand, how would this move the door, I don't see any numbers


Report Abuse
darknaster is not online. darknaster
Joined: 26 Mar 2013
Total Posts: 269
25 Jun 2016 02:58 PM
also, by door you mean I need to group all the parts and name it door?


Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
25 Jun 2016 03:01 PM
I have made a script for you.
You can see it if you want.
I will soon make a place for it.

Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo
Report Abuse
darknaster is not online. darknaster
Joined: 26 Mar 2013
Total Posts: 269
25 Jun 2016 03:09 PM
ok


Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
25 Jun 2016 03:11 PM
Just meet me here: https://www.roblox.com/games/278346816/handsomebob10s-Place-Number-50

Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo
Report Abuse
SpeedySeat is online. SpeedySeat
Joined: 06 Jul 2011
Total Posts: 3048
25 Jun 2016 03:35 PM
Separate the door into 2 models, make the primary part an invisible part on the bottom and issue the :SetPrimaryPartCFrame(cframe) command on the models. That should work.
Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
25 Jun 2016 03:40 PM
-- Put the script in your button.
-- Add a ClickDetector to the button.

local Group = game.Workspace.Model:GetChildren() -- Change this to the directory of your gate.

-- The gate has to be a model.


script.Parent.ClickDetector.MouseClick:connect(function(player)
if script.Parent.BrickColor.Name == "Bright green" then
script.Parent.BrickColor = BrickColor.new("Medium Stone Gray")
for i=1,6 do
wait(0.9)
for i=1,#Group do
Group[i].CFrame = Group[i].CFrame + Vector3.new(0,5,0)
end
end
for i=1,6 do
wait(0.9)
for i=1,#Group do
Group[i].CFrame = Group[i].CFrame - Vector3.new(0,5,0)
end
end
script.Parent.BrickColor = BrickColor.new("Bright green")
end
end)

The CFrame can be adjusted and stuffz.

Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo
Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
25 Jun 2016 03:41 PM
SpeedySeat

Yeah that's much more effective.

Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo
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