XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 14 Jan 2017 11:47 PM |
| anyone have any ideas on what i would use to go about making a part "look" at a player |
|
|
| Report Abuse |
|
|
|
| 15 Jan 2017 12:05 AM |
Insta Look, No wait time, Instant: part.CFrame = CFrame.new(part.Position, player.Position) http://wiki.roblox.com/index.php?title=CFrame#Quick_Reference
or
Smooth Look, "Glides/Tweens" from One Position to the Other: BodyGyro.CFrame = CFrame.new(part.Position, player.Position) http://wiki.roblox.com/index.php?title=API:Class/BodyGyro#Example
|
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 15 Jan 2017 12:13 AM |
| yeah i forgot to put that i found out how, anyhow, do you know if table.concat organizes numbers from least to greatest? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 15 Jan 2017 12:14 AM |
| No it's in the same order the array is in |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 15 Jan 2017 12:25 AM |
| ok thanks, btw does anyone know how to fix the problem that happens whenever the player resets and the part is following them? it seems to break my script when someone falls off the map or resets |
|
|
| Report Abuse |
|
|
Swordlust
|
  |
| Joined: 05 Dec 2016 |
| Total Posts: 476 |
|
|
| 15 Jan 2017 12:25 AM |
CharacterAdded functions can fix that
Tips are always good | https://www.roblox.com/catalog/588125527/Tip |
|
|
| Report Abuse |
|
|
lovesik
|
  |
| Joined: 10 Jul 2014 |
| Total Posts: 194 |
|
| |
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
| |
|
Swordlust
|
  |
| Joined: 05 Dec 2016 |
| Total Posts: 476 |
|
|
| 15 Jan 2017 12:29 AM |
You could also just go into the StarterPlayer, and insert the script into startercharacter so everytime the player dies, it refreshes the character with the script.
Tips are always good | https://www.roblox.com/catalog/588125527/Tip |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 15 Jan 2017 12:30 AM |
| i mean wouldn't it bug out if every player had the script inside of them? |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 15 Jan 2017 12:32 AM |
| characteradded didn't really do anything, ill just add an if v.Character |
|
|
| Report Abuse |
|
|
Swordlust
|
  |
| Joined: 05 Dec 2016 |
| Total Posts: 476 |
|
|
| 15 Jan 2017 12:32 AM |
Having seperate scripts bug out if every player had the script inside their character? Doesn't sound like it would, after all tools don't bug out when every player has them inside of their character..
Tips are always good | https://www.roblox.com/catalog/588125527/Tip |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 15 Jan 2017 12:34 AM |
| wait, u mean like having the part face the local player? cause i need it to the face the closest player, that's why im using magnitude it seems to break whenever the player falls off the map, i fixed the reset problem |
|
|
| Report Abuse |
|
|
Swordlust
|
  |
| Joined: 05 Dec 2016 |
| Total Posts: 476 |
|
|
| 15 Jan 2017 12:37 AM |
If you're having trouble with magnitude and players, you might need to add an if statement comparing the players health + the magnitude. e.g
local part = Instance.new("Part") part.Anchored = true part.CFrame = CFrame.new(0,0,0)
if (part.Position - plr.Character.Torso.Position).magnitude < 5 and plr.Character.Humanoid.Health ~= 0 then print("All is good") end
Tips are always good | https://www.roblox.com/catalog/588125527/Tip |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 15 Jan 2017 12:39 AM |
| ill just add a waitforchild, but yeah if that doesn't work ill try ur way |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 15 Jan 2017 12:40 AM |
| alright it worked, thanks! |
|
|
| Report Abuse |
|
|