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: How come my AI smoker doesn't work :(

Previous Thread :: Next Thread 
Swordphin123 is online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
13 Oct 2010 04:28 PM
dist = 15

while wait() do
print("DIS IS IT!")
for i,v in pairs(game.Players:GetPlayers()) do
print(i,v)
if (v.Character.Torso.Position - script.Parent.Torso.Position).magnitude <= dist then
print("GRAB DA FOOL!")
human = v.Character.Humanoid
tongue = Instance.new("SelectionPartLasso")
pull = Instance.new("BodyPosition")
tongue.Parent = game.Workspace
tongue.Humanoid = human
tongue.Part = script.Parent.Parent.Parent.Character.Head
tongue.Color = BrickColor.new(21)
script.Parent.Remove:clone().Parent = tongue
human.Sit = true
wait(1)
pull.Parent = human.Parent.Torso
pull.position = script.Parent.Head.Position
wait(2)
pull:remove()
wait(30)
else
print("Still not there!")
end
end
end

~~~

I couldn't see the output since my place uses a lot of while true do loops for prints... AND btw, would this NOT grab ALL the players in the server, except for that only 1?
Report Abuse
Kuroki is not online. Kuroki
Joined: 27 Dec 2009
Total Posts: 18058
13 Oct 2010 04:30 PM
Why so many prints, tough?
You should remove them
Report Abuse
oysi93 is not online. oysi93
Joined: 27 Apr 2008
Total Posts: 12469
13 Oct 2010 04:31 PM
Make two variables, one to check distance, and the other to store the player.
Then iterate all players and check if their distance is lower than the distance
you first made your first variable. If it is, set the variable to that distance, and
set the player variable to that player.

Then do st00f on THAT player. =)


local MinDist, ClosestPlayer = 20 -- 20 will be maximum distance
-- The rest you should be able to do yourself if you really made the script you posted --
Report Abuse
Swordphin123 is online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
13 Oct 2010 04:31 PM
In order to see if they work, duh. Because since a lot of my scripts are valuable (the only term i could use) it either doesn't run at all, or doesn't show any outputs.
Report Abuse
Swordphin123 is online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
13 Oct 2010 04:32 PM
@oysi


I editted this script from my Zombie Survival Smoker tool (my other famous place)
Report Abuse
Kuroki is not online. Kuroki
Joined: 27 Dec 2009
Total Posts: 18058
13 Oct 2010 04:32 PM
If they work after youre done testing them, just remove the prints... OR just use pcall
Report Abuse
Swordphin123 is online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
13 Oct 2010 04:33 PM
No i saw a red print in the output. Pretty sure its this one since it doesn't work.
Report Abuse
Kuroki is not online. Kuroki
Joined: 27 Dec 2009
Total Posts: 18058
13 Oct 2010 04:36 PM
Then if the only red print you see is this one, remove all the other prints...
Report Abuse
Swordphin123 is online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
13 Oct 2010 04:37 PM
Wait ok i fixed it lawl missed some variables
Report Abuse
BJCarpenter is online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
13 Oct 2010 04:39 PM
Take the 0ld print statements 0ut, after they have served their purp0se 0f debugging.

Als0, u can expand, and scr0ll 0utput backwards. U will never be able t0 pr0gram, with0ut being able t0 check the 0utput.

Report Abuse
Swordphin123 is online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
13 Oct 2010 04:42 PM
Ha, but why are you guys talking with this 0. Did i say something weird?
Report Abuse
oysi93 is not online. oysi93
Joined: 27 Apr 2008
Total Posts: 12469
13 Oct 2010 04:47 PM
"I editted this script from my Zombie Survival Smoker tool (my other famous place)"

That has nothing to do with anything, at least not my message.
So try what I said, and you'll be happy, I promise. =)
Report Abuse
Swordphin123 is online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
13 Oct 2010 04:48 PM
"-- The rest you should be able to do yourself if you really made the script you posted --"

Yea i know what im doing... I know how to script too alright considering im not risking getting any viruses from free models
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