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: How would I index this as a number

Previous Thread :: Next Thread 
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Jul 2011 12:46 PM
Velocity apparenctly doesn't have the .Changed function in it, so how do I make it a number?


Kid = script.Parent.Parent.Parent.Parent.Parent.Character

repeat wait(1) until Kid:FindFirstChild("Car") ~=nil

Kid.Car.Seat.Velocity.Changed:connect(function ()
script.Parent.Text = "Speed: " ..Kid.Car.Seat.Velocity
end)
Report Abuse
Camoy is not online. Camoy
Joined: 21 May 2009
Total Posts: 6207
15 Jul 2011 12:48 PM
Properties don't have events, objects do.

Kid.Car.Seat.Changed:connect(function(p)
if p == 'Velocity' then
script.Parent.Text = "Speed: " ..Kid.Car.Seat.Velocity
end
end)
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Jul 2011 12:51 PM
Script runs, bot it doesn't seem to do anything now.
Report Abuse
Camoy is not online. Camoy
Joined: 21 May 2009
Total Posts: 6207
15 Jul 2011 12:52 PM
Maybe because the Velocity isn't changing?
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Jul 2011 12:53 PM
Continues to constantly print "3" in the outpt

Kid = script.Parent.Parent.Parent.Parent.Parent.Character
print("1")
repeat wait(1) until Kid:FindFirstChild("Car") ~=nil
print("2")
Kid.Car.Seat.Changed:connect(function(p)
print("3")
if p == 'Velocity' then
print("4")
script.Parent.Text = "Speed: " ..Kid.Car.Seat.Velocity
print("5")
end
end)
Report Abuse
Camoy is not online. Camoy
Joined: 21 May 2009
Total Posts: 6207
15 Jul 2011 12:53 PM
Yeah, probably because the Velocity isn't changing.
Report Abuse
Camoy is not online. Camoy
Joined: 21 May 2009
Total Posts: 6207
15 Jul 2011 12:54 PM
Is this a "Seat" or a "VehicleSeat"?
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Jul 2011 12:55 PM
Well the vehicle is moving
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Jul 2011 12:55 PM
It is Seat.

fld.
Report Abuse
Camoy is not online. Camoy
Joined: 21 May 2009
Total Posts: 6207
15 Jul 2011 12:56 PM
Is the Velocity changing however? Check with the explorer.
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Jul 2011 12:58 PM
For some reason it isn't no.
Report Abuse
Camoy is not online. Camoy
Joined: 21 May 2009
Total Posts: 6207
15 Jul 2011 12:59 PM
Well then that's your problem; see if there is another property that you can latch onto, like RotVelocity.
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Jul 2011 01:01 PM
Nothing seems to be changing in the properties, not even the position, I don't know why.
Report Abuse
Camoy is not online. Camoy
Joined: 21 May 2009
Total Posts: 6207
15 Jul 2011 01:02 PM
That's odd. Just try using "Position" instead of "Velocity". See if it works.
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Jul 2011 01:04 PM
No, nothing is working. I guess I'll just scrap this.
Report Abuse
Camoy is not online. Camoy
Joined: 21 May 2009
Total Posts: 6207
15 Jul 2011 01:05 PM
yeah... I would suggest using a VehicleSeat for movement and making sure the HeadsUpDisplay is enabled. Much easier.
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