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: need help.

Previous Thread :: Next Thread 
xPoloBear is not online. xPoloBear
Joined: 10 Oct 2011
Total Posts: 202
14 Feb 2014 06:16 PM
I want to make it only one person near you to get anchored, but if there is 2 people next to you it anchord both of them how do i make it so only one person gets anchored while the other is standing near me
script:


for i = 1, #g do
if g[i]:findFirstChild("Humanoid") and g[i]:findFirstChild("Torso") and player.Name ~= g[i].Name then
if g[i].Humanoid.Health > 0 then
if (g[i].Torso.Position - a.Position).magnitude <= 100 then
print(g[i].Name)
g[i].Torso.Anchored = true
end
end
end
end
end

Report Abuse
xPoloBear is not online. xPoloBear
Joined: 10 Oct 2011
Total Posts: 202
14 Feb 2014 06:19 PM
Bump
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Feb 2014 06:25 PM
If u made this urself,thisll be easy to understand..

Plrsnear = 0
And then
if Plrsnear == 0 then
Plrsnear = 1
Something like that:)
Report Abuse
xPoloBear is not online. xPoloBear
Joined: 10 Oct 2011
Total Posts: 202
14 Feb 2014 06:26 PM
I did make this on my own.. Df..
Report Abuse
xPoloBear is not online. xPoloBear
Joined: 10 Oct 2011
Total Posts: 202
14 Feb 2014 06:32 PM
Bump
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
14 Feb 2014 06:41 PM
Don't worry he's just trying to sound smart.
I'm assuming you're getting players.
Is A defined?

for _,plr in pairs(game.Players:GetChildren()) do
if plr.Character then
if (plr.Character:FindFirstChild("Humanoid")) and player.Character.Humanoid.Heakth > 0 then
if (plr.Character.Torso.Position - a.Position).magnitude <= 100 then
print(plr.Name)
plr.Character.Torso.Anchored = true
end
end
end
end

Report Abuse
xPoloBear is not online. xPoloBear
Joined: 10 Oct 2011
Total Posts: 202
14 Feb 2014 06:51 PM
Yes A is defined as a Part in workspace

and a typo on the 3rd line: Heakth suppose to be Health

and how is this suppose to make only one person anchored if 2 people standing by me.
They all get anchored, and i dont want that.

anyways thanks thou
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
14 Feb 2014 06:54 PM
in = false
for _,plr in pairs(game.Players:GetChildren()) do
if plr.Character then
if (plr.Character:FindFirstChild("Humanoid")) and player.Character.Humanoid.Health > 0 then
if (plr.Character.Torso.Position - a.Position).magnitude <= 100 and not in then
print(plr.Name)
plr.Character.Torso.Anchored = true
in = true
end
end
end
end
Report Abuse
xPoloBear is not online. xPoloBear
Joined: 10 Oct 2011
Total Posts: 202
14 Feb 2014 06:57 PM
Worked Thanks!
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Feb 2014 07:58 PM
"in = false"
"If not in then"
"In = true"
Hello?isn't that almost exactly what I said?
"Plrsnear = 0"
"If Plrsnear == 0 then"
"Plrsnear = 1"
....
"He's just trying to sound smart"
And ur solution to it,was exactly what I said,only phrased diffrently
"Plrsnear"
"In"
0,false,1,true

Like cmon,gimme some credit..
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
14 Feb 2014 08:28 PM
Not that, just saying that he didn't make it himself.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Feb 2014 08:37 PM
Oh,lol,THAT much I gathered..lol
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