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: RanSelect + MoveTo + Transby

Previous Thread :: Next Thread 
GuestCapone is not online. GuestCapone
Joined: 19 Oct 2012
Total Posts: 1928
05 Mar 2013 11:30 PM
I'm trying to make a script that'll spawn a model from Lighting, move it the the model that has this script in it..
Get the spawned model's name and move it father..
I'm stuck at SP, I don't know how to check the model's name and then move it..
Thought I had it right, but I guess not.
So now I'm stuck right at "local SP", don't want what I'm suppose to do now.

wait(.1)
local MapPart = Instance.new("Model")
MapPart.Parent = script.Parent.Parent
MapPart.Name = "SpawnedPartName"
print("spawning map peice")
maps = game.Lighting.Maps:GetChildren()
randmap=maps[math.random(1, #maps)]
for i=1,#maps do
if maps[i]==randmap then
c=maps[i]:Clone()
c.Parent=script.Parent.Parent.SpawnedPartName
c:MoveTo(script.Parent.Position)
c:TranslateBy(Vector3.new(0,0,-.5))
wait(.2) --Just to make sure the model spawns.
c:TranslateBy(Vector3.new(0,-10.4,0))
wait()
local SP = script.Parent.Parent.SpawnedPartName:GetChildren() --stuck here.
if SP = Straight then
c:TranslateBy(Vector3.new(0,-10.4,0))
elseif SP = Corner then
c:TranslateBy(Vector3.new(0,-20.4,0))
elseif SP = Tsection then
c:TranslateBy(Vector3.new(0,-30.4,0))
print("moving")
end
end
end

Help please.
Report Abuse
owenrules12 is not online. owenrules12
Joined: 26 Mar 2009
Total Posts: 402
06 Mar 2013 01:46 AM
I don't understand why you have
if SP = Straight then

For a start you need;

if SP == Straight then

But I also can't see where SP shows Straight Corner or Tsection.
Report Abuse
GuestCapone is not online. GuestCapone
Joined: 19 Oct 2012
Total Posts: 1928
06 Mar 2013 03:10 PM
That's what I'm trying to do... get the script to check SP to see what its child is, then move its child on one of the select options..
Report Abuse
GuestCapone is not online. GuestCapone
Joined: 19 Oct 2012
Total Posts: 1928
06 Mar 2013 03:53 PM
bump
Report Abuse
jacklollz2 is not online. jacklollz2
Joined: 08 Oct 2010
Total Posts: 1183
06 Mar 2013 05:24 PM
First of all, Straight is not a falled callback function, or a property. Second, you have major script errors and you are missing lots of lines of code.
Report Abuse
GuestCapone is not online. GuestCapone
Joined: 19 Oct 2012
Total Posts: 1928
06 Mar 2013 07:13 PM
Would you be helpful by telling me what im missing? Cause that's the code I wrote, nothing missing. thats the complete script.
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