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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|