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: BindableEvent help?

Previous Thread :: Next Thread 
theyoungster is not online. theyoungster
Joined: 23 Sep 2007
Total Posts: 672
20 Feb 2013 10:20 AM
I'm trying to use a BindableEvent to call something of a 'subroutine' in my scripts. Only problem is, the connection isn't working.
Here's my script:


function onFire(obj,ox,oy,nx,ny)
local time=0
local addx=nx-ox
local addy=ny-oy
while time<1 do
time=time+.01
nofs=math.sin(time*3.14159/2)
obj.CFrame=vector3.New(ox+nofs*addx,oy+nofs*addy,obj.Position.Z)
wait(.01)
end
end

game.Workspace.move.Event:connect(onFire)


And the error:

11:18:33 - Workspace.Mover:13: attempt to index field 'move' (a function value)
11:18:33 - Script "Workspace.Mover", Line 13
11:18:33 - stack end


I haven't worked much with BindableEvents, so i'm not entirely sure what i'm doing wrong.
Report Abuse
theyoungster is not online. theyoungster
Joined: 23 Sep 2007
Total Posts: 672
20 Feb 2013 10:21 AM
Oh, i forgot to add; 'move' is the bindableevent in game.Workspace.
Report Abuse
cart6157 is not online. cart6157
Joined: 28 Feb 2009
Total Posts: 2194
20 Feb 2013 10:23 AM
XD
Report Abuse
theyoungster is not online. theyoungster
Joined: 23 Sep 2007
Total Posts: 672
20 Feb 2013 10:29 AM
I don't get it. What is it that you find so amusing?
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
20 Feb 2013 10:37 AM
Put the Script in the BindableEvent, and then use script.Parent
Report Abuse
theyoungster is not online. theyoungster
Joined: 23 Sep 2007
Total Posts: 672
20 Feb 2013 10:46 AM
changed it to have the script inside the event, but i'm still getting the same error. 'Attempt to index field 'move' (a function value)'.
Report Abuse
theyoungster is not online. theyoungster
Joined: 23 Sep 2007
Total Posts: 672
20 Feb 2013 10:48 AM
edit: now the script isn't immediatley throwing out the error, it's only being thrown when i attempt to activate the event.
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
20 Feb 2013 10:49 AM
change:

*snip*game.Workspace.move.Event:co*snip*

to

script.Parent.Event
Report Abuse
theyoungster is not online. theyoungster
Joined: 23 Sep 2007
Total Posts: 672
20 Feb 2013 10:51 AM
did that before posting.
Report Abuse
theyoungster is not online. theyoungster
Joined: 23 Sep 2007
Total Posts: 672
20 Feb 2013 11:35 AM
anyone?
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