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: Does .Changed event work on Vector3 values?

Previous Thread :: Next Thread 
Jake0128 is not online. Jake0128
Joined: 09 Aug 2013
Total Posts: 1631
21 Dec 2014 06:03 PM
title says it all.

Im getting this in the output

Changed is not a valid member
19:01:07.842 - Script 'Workspace.Script', Line 18
19:01:07.842 - Stack End

-------------------------------------------------------------

Here's the script
-------------------------------------------------------------

height=0
part=workspace.Part
head=workspace.Player.Head

function lol()

end



head.Position.Changed:connect(lol)
Report Abuse
Froast is not online. Froast
Joined: 12 Mar 2009
Total Posts: 3134
21 Dec 2014 06:04 PM
head.Changed:connect(function(property)
if property == 'Position' then
do stuff
end
end)
Report Abuse
Jake0128 is not online. Jake0128
Joined: 09 Aug 2013
Total Posts: 1631
21 Dec 2014 06:06 PM
@Froast





Now there is nothing in the output, but nothing is firing.
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
21 Dec 2014 06:09 PM
I had a similar problem where I was also trying to fire something each time the position is changed. The correct way to use changed is using on something you can Instance, so not properties. You can't do Instance.new("BrickColor"),etc so you have to use changed on the part. I also was not able to fire the event with position changes.

head.Changed:connect(function()
360MLGPro()
end)
Report Abuse
flump is not online. flump
Joined: 30 Jul 2008
Total Posts: 1039
21 Dec 2014 06:10 PM
Vector3 and CFrame only fire the Changed event when changed within a script so your unable to use that to detect when a player moves.

Use something Like Humanoid.Walking
Report Abuse
Jake0128 is not online. Jake0128
Joined: 09 Aug 2013
Total Posts: 1631
21 Dec 2014 06:11 PM
Still getting nothing. As in, the function isn't running.

Here's the source:







height=0
part=workspace.Part
head=workspace.Player.Head

function k()
print("mmmmmmmmm")
end


head.Changed:connect(k)
Report Abuse
Jake0128 is not online. Jake0128
Joined: 09 Aug 2013
Total Posts: 1631
21 Dec 2014 06:18 PM
That worked, flump, but it's not really what I'm looking for.

I want to create something like this:


As a person gets closer to a door, it rises.
As the person gets farther away, it falls.


I'm using the magnitude property but I can't seem to find a way to implement it correctly. If I just use .Running then the function only fires once when they start running towards the door. (Obviously not what I'm looking for)
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