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: Just made this, can't get it to work.

Previous Thread :: Next Thread 
TacoConsumer is not online. TacoConsumer
Joined: 24 Apr 2010
Total Posts: 1563
18 Nov 2012 08:31 PM
Here is the script.

Bt1 = Script.Parent.Parent.btn1

function onClicked(mouse)

Bt1.ClickDetector.MaxActivationDistance = 0

script.Parent.ClickDetector.MouseClick:connect(onClicked)


end

Originally, the brick it was in was on it's own in the workspace and the "Script.Parent.Parent" was "game.Workspace.Elevator.Bt1" but that gave me an error in the output. So I grouped it.

What have I done wrong?
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
18 Nov 2012 08:33 PM
The event calling the Function can't be in the Function itself unless You're repeating it.



Bt1 = Script.Parent.Parent.btn1

function onClicked()
Bt1.ClickDetector.MaxActivationDistance = 0
end


script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
TacoConsumer is not online. TacoConsumer
Joined: 24 Apr 2010
Total Posts: 1563
18 Nov 2012 08:39 PM
While I've got you here, can you explain what "eof" is? I got it in the output for another script and it says that there was an exepected one at line 48 or something.

(for a different script!)
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
18 Nov 2012 08:40 PM
eof stands for "end of function"
Report Abuse
TacoConsumer is not online. TacoConsumer
Joined: 24 Apr 2010
Total Posts: 1563
18 Nov 2012 08:41 PM
I figured that, but what would that look like? Exactly that? Just put "end of function" at line 48?
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
18 Nov 2012 08:43 PM
What is the entire output?
Report Abuse
TacoConsumer is not online. TacoConsumer
Joined: 24 Apr 2010
Total Posts: 1563
18 Nov 2012 08:44 PM
Every time I try and post it, it gives me an error. Do you want me to post the enitre script and you could give it a look?
Report Abuse
MassiveGman is not online. MassiveGman
Joined: 23 Jan 2011
Total Posts: 2019
18 Nov 2012 08:45 PM
eof
end of function

you need an end an end) or a connection line.



|Paradoxical|

I shun thy heathen, dost thou not know that flames will devour thy mind?
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
18 Nov 2012 08:45 PM
Sure, taco.
Report Abuse
MassiveGman is not online. MassiveGman
Joined: 23 Jan 2011
Total Posts: 2019
18 Nov 2012 08:45 PM
on line 48, or an end for line 48



|Paradoxical|

I shun thy heathen, dost thou not know that flames will devour thy mind?
Report Abuse
TacoConsumer is not online. TacoConsumer
Joined: 24 Apr 2010
Total Posts: 1563
18 Nov 2012 08:47 PM
Here it is. The "door" is supposed to go down, then come back up. However it goes down, then stays down.

open = script.Parent.Parent.Open
ready = script.Parent.Parent.Ready
move = script.Parent.Parent.Move.Value
speed = script.Parent.Parent.Speed.Value
M = script.Parent.Parent.DecalChanger.Sign

function go()


if open.Value == false then
if ready.Value then
ready.Value = false
open.Value = true
M.Texture = "http://www.roblox.com/asset/?id=97854675"
wait(2)
M.Texture = "http://www.roblox.com/asset/?id=97854703"

for i = 1,move do
wait(speed)
for i,v in pairs(script.Parent.Parent:GetChildren()) do
if v.Name == "Door" then
v.CFrame = v.CFrame + Vector3.new(0,-0.3,0)


for i = 1,move do
wait(speed)
for i,v in pairs(script.Parent.Parent:GetChildren()) do
if v.Name == "Door" then
v.CFrame = v.CFrame + Vector3.new(0,0.3,0)
M.Texture = "http://www.roblox.com/asset/?id=97854734"
end
end
end
ready.Value = true
end
end

end
end
end
end
end
end
script.Parent.ClickDetector.MouseClick:connect(go)
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
18 Nov 2012 08:49 PM
Too many ends.

Remove.... 3 I believe.
Report Abuse
TacoConsumer is not online. TacoConsumer
Joined: 24 Apr 2010
Total Posts: 1563
18 Nov 2012 08:50 PM
It kept saying in the output that ends were expected. I kept adding them until it stopped. So, remove three? Then the script should work?
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
18 Nov 2012 08:51 PM
Try it and let's see.
Report Abuse
TacoConsumer is not online. TacoConsumer
Joined: 24 Apr 2010
Total Posts: 1563
18 Nov 2012 08:57 PM
Alright, two things.

1. It doesn't work, the door doesn't even go down anymore.

2. The first model doesn't work. The buttons turn reflective when I click them, which leads me to believe that the other script (that turns the other elevator buttons refelctive is interfering)

*I have to go in RL for a couple minutes, I'll post here/message you when I'm back.
Report Abuse
TacoConsumer is not online. TacoConsumer
Joined: 24 Apr 2010
Total Posts: 1563
18 Nov 2012 09:10 PM
Back, figure anything out?
Report Abuse
TacoConsumer is not online. TacoConsumer
Joined: 24 Apr 2010
Total Posts: 1563
19 Nov 2012 04:46 PM
Can anyone else help?
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
19 Nov 2012 09:17 PM
I would go into Studio and fix this but I gotta go to bed, Sorry.
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