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: Help debug

Previous Thread :: Next Thread 
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
20 May 2013 06:47 PM
So...

function OnClicked(Part)
Workspace.P1.Position = -12.5, 6.2, 18


So I tryed to make a Part in Workspace moved the part name is P1 For some reason this is not working
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
20 May 2013 06:56 PM
Workspace.P1.Position = Vector3.new(-12.5, 6.2, 18)
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
20 May 2013 07:56 PM
It still won't work
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
20 May 2013 07:58 PM
Add an 'end' to the function, and call the function.
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
20 May 2013 07:58 PM
Oh yeah all functions need an end.And whats a call?
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
20 May 2013 08:00 PM
You can call it using..

OnClicked()

Or you can use a connection line, so the function is called when an event is triggered..

For example, if this script is inside of a brick.
script.Parent.Touched:connect(OnClicked())
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
20 May 2013 08:07 PM
So I came up with this
function OnClicked(Part)
Workspace.P1.Position = -12.5, 6.2, 18

script.Parent.Touched:connect(OnClicked())
end

Still won't work
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
20 May 2013 08:09 PM
The wonders of scripting...
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
20 May 2013 08:10 PM
You still need to do what the other user suggested.
Also, the end goes before the connection.

function OnClicked()
Workspace.P1.Position = Vector3.new(-12.5,6.2,18)
end
script.Parent.Touched:connect(OnClicked())
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
20 May 2013 08:11 PM
function OnClicked(Part)
Workspace.P1.Position = Vector3.new(-12.5, 6.2, 18)--Vector3.new()
end--end in wrong place
script.Parent.Touched:connect(OnClicked) --()?
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
20 May 2013 08:15 PM
Mhmm. That's just about the same as what I posted.
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
20 May 2013 08:16 PM
Except mine was wrong and yours was right. :P
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
20 May 2013 08:16 PM
:3
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
20 May 2013 08:18 PM
Not working
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
20 May 2013 08:19 PM
...So I came up with this
function OnClicked()
then Workspace.P1.Position = Vector3.new(-12.5,6.2,18)
end
script.Parent.Touched:connect(OnClicked())

The thing that is new is the then so when I click the part it the will move
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
20 May 2013 08:22 PM
...Oh derp
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
20 May 2013 08:23 PM
S.O.S HELP THIS GUY
(------------------------------------
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
20 May 2013 08:23 PM
Sorry. Change the connection line to..
script.Parent.Touched:connect(OnClicked)

And you have to touch it
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
20 May 2013 08:27 PM
Still won't work
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
20 May 2013 08:29 PM
That script will only work if you touched it. A different event is needed if you want to click it.


script.Parent.ClickDetector.MouseClick:connect()
Where you need to add a ClickDetector.
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
20 May 2013 08:30 PM
I added a Clickdector already
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
21 May 2013 06:14 AM
It won't work
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
21 May 2013 06:16 AM
So I got this

function OnClicked()
Workspace.P1.Position = Vector3.new(-12.5,6.2,18)
end
script.Parent.ClickDetector.MouseClick:connect()



Still won't work
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
21 May 2013 06:19 AM
Someone help me please!
Report Abuse
blackshockwave is not online. blackshockwave
Joined: 16 Mar 2012
Total Posts: 1381
21 May 2013 06:21 AM
Awwwww Cmon
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