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: Change:connect()?

Previous Thread :: Next Thread 
gangman67 is not online. gangman67
Joined: 04 Jun 2011
Total Posts: 798
19 Jan 2016 03:45 PM
How would I fire a function when they players position changes?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
19 Jan 2016 03:48 PM
Player.Character.Torso.Changed:connect(function(property)
local value = Player.Character[property]
print("Torso's " .. property .. " changed to " .. tostring(value))
end)



Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
19 Jan 2016 03:50 PM
Sorry! I really need to learn to proofread.
Make sure Player is properly referenced, and this will fire every time it changes. You probably want a debounce on there - otherwise it will be information overload.
You can adapt this to look JUST at the positional coordinates if you desire. but this will give you every change of every property in the Torso.

Player.Character.Torso.Changed:connect(function(property)
local value = Player.Character.Torso[property]
print("Torso's " .. property .. " changed to " .. tostring(value))
end)


Report Abuse
gangman67 is not online. gangman67
Joined: 04 Jun 2011
Total Posts: 798
19 Jan 2016 03:58 PM
Doesnt work
Report Abuse
gangman67 is not online. gangman67
Joined: 04 Jun 2011
Total Posts: 798
19 Jan 2016 04:02 PM
lol I am so dumb sometimes, I was thinking that it would fire every second an I thought of a better way to do what i need
Report Abuse
GliconCraft is not online. GliconCraft
Joined: 17 Dec 2015
Total Posts: 99
19 Jan 2016 04:08 PM
The Changed event fires whenever the specified object changes, although it has some bugs sometimes on what it likes to pick up. Like, I've noticed that sometimes it doesn't like to pick up changes in Velocity or Position, not sure about other things. It doesn't have to be looped to fire all the time, because it fires when that object changes. :P
Report Abuse
gangman67 is not online. gangman67
Joined: 04 Jun 2011
Total Posts: 798
19 Jan 2016 04:09 PM
Lol, fail again qq Ok so I am making a sea and when a player gets in the sea They are supposed to be able to swim, I need to make a body position when they get to a certain point On the Y how would I do this without spamming functions a bunch of while loops, I was going to try OnTouch but its a mesh qq
Report Abuse
gangman67 is not online. gangman67
Joined: 04 Jun 2011
Total Posts: 798
19 Jan 2016 04:10 PM
OH WAIT could Humanoid.FallingDown:connect work?
Report Abuse
GliconCraft is not online. GliconCraft
Joined: 17 Dec 2015
Total Posts: 99
19 Jan 2016 04:35 PM
Well, depending on how you have it set up, you could just make it so that when a player's torso position goes below a certain height, it enables whatever you're having happen to make them swim. Although, in order for that to be a way around, your water would have to be limited to being underneath the lowest floor that the player can stand on.
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
19 Jan 2016 04:37 PM
Look at Davidii's survival 303 - I believe you can find an uncopylocked version, or a free model of the whole place.

If you jump into the ocean, you'll swim right back up. Has something to do with BodyVelocities and locking position on the y-axis.


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