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: Dieing when spawned?

Previous Thread :: Next Thread 
speedydude900 is online. speedydude900
Joined: 02 Feb 2010
Total Posts: 788
26 Oct 2014 05:27 AM
The script is suppose to move the AI into it's spawn position but when it moves the torso to the position it dies. Help?

player = script.Parent.Parent.Parent.Parent.Parent
money = player.leaderstats.Cash
cost = 50
upgradeStuff = game.ServerStorage["Scout Defender"]

function buy()
if money.Value >= 50 then
money.Value = money.Value - cost
roll = math.random(1,6)
local a = upgradeStuff:clone()
a.Parent = game.Workspace
a.Humanoid.Health = 250
if roll == 1 then
a.Torso.Position = game.Workspace.Spawn1.Position
elseif roll == 2 then
a.Torso.Position = game.Workspace.Spawn2.Position
elseif roll == 3 then
a.Torso.Position = game.Workspace.Spawn3.Position
elseif roll == 4 then
a.Torso.Position = game.Workspace.Spawn4.Position
elseif roll == 5 then
a.Torso.Position = game.Workspace.Spawn5.Position
elseif roll == 6 then
a.Torso.Position = game.Workspace.Spawn6.Position
end
end
end
script.Parent.MouseButton1Down:connect(buy)
Report Abuse
WishNite is not online. WishNite
Joined: 11 Feb 2009
Total Posts: 15828
26 Oct 2014 05:47 AM
move the model using MoveTo
Report Abuse
speedydude900 is online. speedydude900
Joined: 02 Feb 2010
Total Posts: 788
26 Oct 2014 02:18 PM
The model itself or just the torso?
Report Abuse
FauxHawke is not online. FauxHawke
Joined: 08 Jun 2012
Total Posts: 2190
26 Oct 2014 02:32 PM
model itself

Never trust atoms, they make up everything.™
Report Abuse
speedydude900 is online. speedydude900
Joined: 02 Feb 2010
Total Posts: 788
26 Oct 2014 04:20 PM
So how would it look like in code? Never used MoveTo this way.
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