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: Minion script

Previous Thread :: Next Thread 
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Aug 2011 05:16 PM
i fixed some errors, but it still doesn't work... its supposed to make 10 clones of me that all follow, but it doesn't work at all... i'm running this in SB

for x = 1,10 do
un = game.Workspace.MrgamesNwatch:GetChildren()
for i = 1,#un do
un[i].Archivable = true
end
c = game.Workspace.MrgamesNwatch
c.Archivable = true
a = c:Clone()
a.Parent = game.Workspace
a:MakeJoints()
a:MoveTo(game.Players.MrgamesNwatch.Character.Torso.Position)
local f = Instance.new("BodyPosition")
f.Parent = a.Torso
f.position = game.Players.MrgamesNwatch.Character.Torso.Position
f.maxTorque = Vector3.new(10000,100000,100000)
end

while wait() do
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == "MrgamesNwatch" and v.Torso.BodyPosition ~= nil then
v.Torso.BodyPosition.position = game.Players.MrgamesNwatch.Character.Torso.Position
end end end
Report Abuse
Taaztreyon is not online. Taaztreyon
Joined: 07 Aug 2011
Total Posts: 37
24 Aug 2011 05:24 PM
1. You don't have to use the MoveTo, or the MakeJoints.
2. You don't have to use a for to clone yourself. Just clone yourself as a whole and then insert the BodyPosition into the clone.
3. Isn't there a property in the humanoid that is like WalkToPoint or something?
4. Don't use a while true do for the positioning, just used a changed event on your Torso.
Report Abuse
Taaztreyon is not online. Taaztreyon
Joined: 07 Aug 2011
Total Posts: 37
24 Aug 2011 05:26 PM
Umm. Want me to just remake the script?
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Aug 2011 05:26 PM
eh, sure
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Aug 2011 05:34 PM
although I'd prefer to keep the BodyVelocity. That way the clones would unrealisticly swarm around me ^.^
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Aug 2011 07:11 PM
this really isn't that complicated yet i cannot get it to work >.<
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Aug 2011 08:09 PM
ok, i rewrote the script. the cloning part works fine, but the following part doesn't work at all... there would happen to be no Output which seems to always happen to me :\

local subject = "Player"

for x = 1,10 do
un = game.Workspace[subject]:GetChildren()
for i = 1,#un do
un[i].Archivable = true
end
c = game.Workspace[subject]
Mr = game.Players[subject].Character
c.Archivable = true
a = c:Clone()
a.Parent = game.Workspace
a:MakeJoints()
a:MoveTo(Mr.Torso.Position)
end

print("Minions created")

--Follow part
while wait() do
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == subject then
local char = v
local check = game.Players:GetPlayerFromCharacter(char)
if v ~= char then
v.Torso.Humanoid:MoveTo(Mr.Torso.Position,Mr.Torso)
end end end end
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Aug 2011 08:18 PM
bump
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
24 Aug 2011 08:20 PM
Make sure output is on when you join..
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Aug 2011 08:21 PM
yeah, i had the output open when i ran the script. "minions created" printed and then nothing else.
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
24 Aug 2011 08:27 PM
You have that if v ~= char thing in there, make sure v = char, I'm sorry I can't really help you because I have absolutely no experience in pairs/ipairs. >.<
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
24 Aug 2011 08:29 PM
Perhaps its because you try to get the player of the minion? Which = nil?
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Aug 2011 08:33 PM
possibly, i've never used GetPlayerFromCharacter to check it something is the Players Character or not.
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
24 Aug 2011 08:35 PM
GetPlayerFromCharacter() gets the person controlling the humanoid in game.Players. The bot isn't being controlled by anyone, therefore it returns nil.
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Aug 2011 08:42 PM
if char == nil then
should fix that part then... i think
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
24 Aug 2011 08:43 PM
Tell me how it works out.
~This is my siggy~
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Aug 2011 08:46 PM
:\ same problem no output, but adding a print told me that "if char == nil then" is not doing anything.


for x = 1,10 do
un = game.Workspace[subject]:GetChildren()
for i = 1,#un do
un[i].Archivable = true
end
c = game.Workspace[subject]
Mr = game.Players[subject].Character
c.Archivable = true
a = c:Clone()
a.Parent = game.Workspace
a:MakeJoints()
a:MoveTo(Mr.Torso.Position)
end

print("Minions created")

while wait() do
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == subject then
local char = v
local check = game.Players:GetPlayerFromCharacter(char)
if char == nil then
print("following")
v.Humanoid:MoveTo(Mr.Torso.Position,Mr.Torso)
end end end end
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
24 Aug 2011 08:50 PM
Why do you have 4 ends? You only need 3.
As for moving on the top...I think it has to be a.Humanoid.
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Aug 2011 08:52 PM
2 if statements 2 loops = 4 ends. What do you mean by ".Humanoid"
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
24 Aug 2011 08:55 PM
for x = 1,10 do
un = game.Workspace[subject]:GetChildren()
for i = 1,#un do
un[i].Archivable = true
end
c = game.Workspace[subject]
Mr = game.Players[subject].Character
c.Archivable = true
a = c:Clone()
a.Parent = game.Workspace
a:MakeJoints()
a.Humanoid:MoveTo(Mr.Torso.Position) --here
end

print("Minions created")

while wait() do
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == subject then
local char = v
local check = game.Players:GetPlayerFromCharacter(char)
if char == nil then
print("following")
v.Humanoid:MoveTo(Mr.Torso.Position,Mr.Torso) --you do it right here
end end end end
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
24 Aug 2011 08:56 PM
for x = 1,10 do
un = game.Workspace[subject]:GetChildren()
for i = 1,#un do
un[i].Archivable = true
end
c = game.Workspace[subject]
Mr = game.Players[subject].Character
c.Archivable = true
a = c:Clone()
a.Parent = game.Workspace
a:MakeJoints()
a.Humanoid:MoveTo(Mr.Torso.Position) --here
end

print("Minions created")

while wait() do
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == subject then
local char = v
local check = game.Players:GetPlayerFromCharacter(char)
if check == nil then --change from char to check
print("following")
v.Humanoid:MoveTo(Mr.Torso.Position,Mr.Torso) --you do it right here
end end end end
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
24 Aug 2011 08:57 PM
:/ stupid floodcheck.
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
24 Aug 2011 09:02 PM
Thanks Tech! i just needed to change char to check like you said. btw the first MoveTo is for the position of the model EX: game.Workspace.Model:MoveTo(Vector3.new(0,10,0))
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
25 Aug 2011 06:50 AM
You don't mind if I use this too, do you?
Report Abuse
MrgamesNwatch is not online. MrgamesNwatch
Joined: 02 Feb 2009
Total Posts: 7729
25 Aug 2011 11:45 AM
you can use this version. i plan on adding on anyways :P
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