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: Local Script vs. Model

Previous Thread :: Next Thread 
BogyMac is not online. BogyMac
Joined: 04 Nov 2011
Total Posts: 823
27 Feb 2014 11:48 AM
So, I cannot figure this out.

I have a Local Script in StarterGui that clones a model from Lighting and places it in your Camera (so it is not seen and cannot be interacted with by other players). Then, the Local Script enables a script within the cloned model which "TranslateBy"'s the model in a certain direction.

It works fine in PlaySolo, but not in Start Server > Start Player

There are no errors anywhere.

From this information, can you tell me what I am doing wrong here, or do you need to see the script?

Thanks,
-Bogy
Report Abuse
Vexedly is not online. Vexedly
Joined: 15 Sep 2006
Total Posts: 7011
27 Feb 2014 11:48 AM
[ Content Deleted ]
Report Abuse
BogyMac is not online. BogyMac
Joined: 04 Nov 2011
Total Posts: 823
27 Feb 2014 11:50 AM
Local Script:
---------------------------------------------
jet01 = game.Lighting.Jet01:Clone()
jet01.Parent = workspace.CurrentCamera
jet01.Move.Disabled = false
---------------------------------------------

Disabled Script in Model:
---------------------------------------------
while wait() do
script.Parent:TranslateBy(Vector3.new(5,-0.2,0))
end
---------------------------------------------
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
27 Feb 2014 11:54 AM
Is the while loop in a local script?
Report Abuse
BogyMac is not online. BogyMac
Joined: 04 Nov 2011
Total Posts: 823
27 Feb 2014 11:55 AM
Negative. The Script in the "Jet01" model is not Local.
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
27 Feb 2014 12:02 PM
Make it local then Start Server> Start Player
Report Abuse
BogyMac is not online. BogyMac
Joined: 04 Nov 2011
Total Posts: 823
27 Feb 2014 12:06 PM
No, still doesn't work :(
Report Abuse
BogyMac is not online. BogyMac
Joined: 04 Nov 2011
Total Posts: 823
27 Feb 2014 12:24 PM
^
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
27 Feb 2014 12:31 PM
Put the while loop in the same script that clones it,right after it clones it(I don't think scripts in models,block,etc can run in the camera..)

So like
StarterGui
-LocalScript
Lighting
-Jet

--blablah,clone the jet
.Parent = Workspace.CurrentCamera
--add the while loop here,refrencing to the clone of the jet
Report Abuse
BogyMac is not online. BogyMac
Joined: 04 Nov 2011
Total Posts: 823
27 Feb 2014 12:34 PM
Alright. I'll test it out, hold on...
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
27 Feb 2014 12:37 PM
Scripts don't run in Camera.
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
27 Feb 2014 12:37 PM
So an example:
StarterGui
-LocalScript
Lighting
-Model
--Part

m = game.Lighting.Model:clone()
m.Parent = Workspace.CurrentCamera
while wait() do
m.Part.CFrame = m.Part.CFrame*CFrame.Angles(0,0.1,0)
end

--this will make the part spin around and around :)
This is just an example
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
27 Feb 2014 12:38 PM
Like trix said,scripts don't run in the camera /\_/\
But I said it first XD
Report Abuse
BogyMac is not online. BogyMac
Joined: 04 Nov 2011
Total Posts: 823
27 Feb 2014 12:40 PM
Same thing, doesn't move. Script:

jet01 = game.Lighting.Jet01:Clone()
jet01.Parent = workspace.CurrentCamera
distanceFromStart01 = 0
repeat wait()
jet01:TranslateBy(Vector3.new(5,-0.2,0))
distanceFromStart01 = distanceFromStart01 + 1
until distanceFromStart01 >= 50

I don't think it has anything to do with communication. I think there is some reason why TranslateBy() doesn't work in while being a descendant of a Camera Object, or something weird like that.

._.
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
27 Feb 2014 12:43 PM
Hmm
Maybe use CFraming for the jet
Like
(The pieces are all attached right?)
Jet.MainPart.CFrame = Jet.MainPart.CFrame*CFrame.new(5,-0.2,0)
Report Abuse
BogyMac is not online. BogyMac
Joined: 04 Nov 2011
Total Posts: 823
27 Feb 2014 12:46 PM
The model I am moving is Anchored. I don't know if moving the Central Part of a model will work. I can try though.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
27 Feb 2014 12:46 PM
Try changing the script in your model to a LocalScript.
Report Abuse
BogyMac is not online. BogyMac
Joined: 04 Nov 2011
Total Posts: 823
27 Feb 2014 12:48 PM
@Agent, already tried that. The problem does not lie with the script itself. I have already moved the coding over to the core script that does all the work.
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
27 Feb 2014 12:49 PM
/\
He already tried that,so were attempting to add it INTO the current localscript..
And TranslateBy doesn't seem to be working..
Maybe
Jet:MoveTo(Jet.MainPart.CFrame*CFrame.new(5,-0.2,0)
Or
Jet:MoveTo(Jet.MainPart.Position+Vector3.new(5,0.2,0)
Also,body velocity might be a good idea,instead of that..idk
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
27 Feb 2014 12:50 PM
Ok,dumb question time:
Output?
Report Abuse
BogyMac is not online. BogyMac
Joined: 04 Nov 2011
Total Posts: 823
27 Feb 2014 12:52 PM
Darn, this is so frustrating! Same result with this script:

jet01 = game.Lighting.Jet01:Clone()
jet01.Parent = workspace.CurrentCamera
jet01.PrimaryPart = jet01.MoveToPart
distanceFromStart01 = 0
repeat wait()
jet01.PrimaryPart.CFrame = jet01.PrimaryPart.CFrame*CFrame.new(5,-0.2,0)
istanceFromStart01 = distanceFromStart01 + 1
until distanceFromStart01 >= 50

Also, I don't think MoveTo will work. The reason why I went with TranslateBy in the first place is because MoveTo was EXTREMELY glitchy and messed everything up.
Report Abuse
BogyMac is not online. BogyMac
Joined: 04 Nov 2011
Total Posts: 823
27 Feb 2014 12:52 PM
And no errors whatsoever. Everything is fine.
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
27 Feb 2014 12:55 PM
UGH ROBLOX Y U DO DIS???
UGHHH
Ok,last attempt here(maybe)
Unanchor it,put a bodyvelocity in it with the velocity of:
Vector3.new(5,2,0)
Lighting
-Jet
--MainPart
---BodyVelocity
Report Abuse
BogyMac is not online. BogyMac
Joined: 04 Nov 2011
Total Posts: 823
27 Feb 2014 12:58 PM
I might use BodyPosition. Brb, gonna try it.
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
27 Feb 2014 01:01 PM
BodyPosition sets the position in mid air..instant
BodyVelocity propells it
BodyThrust does same thing as bv but..it thrusts once,and then is gone,that kinda thing
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