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: Substitutions

Previous Thread :: Next Thread 
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
25 Jun 2014 10:29 AM
What are some substitutions for LocalPlayer that works?
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
25 Jun 2014 11:10 AM
PlayerAdded
Report Abuse
1MangoMan0 is not online. 1MangoMan0
Joined: 28 Sep 2010
Total Posts: 1596
25 Jun 2014 11:34 AM
Above, and:

script.Parent.Parent.Parent... etc.
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
25 Jun 2014 10:38 PM
I mean after they spawn. I should be more specific.
Report Abuse
DigitalVeer is not online. DigitalVeer
Joined: 23 Jun 2009
Total Posts: 4182
25 Jun 2014 10:39 PM
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(steve)
print("The player of this guy is " .. p.Name)
end)
end)
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
25 Jun 2014 11:02 PM
Why do you need it?
Report Abuse
1MangoMan0 is not online. 1MangoMan0
Joined: 28 Sep 2010
Total Posts: 1596
25 Jun 2014 11:18 PM
Yeah man. Gotta give us some context.
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
26 Jun 2014 07:58 AM
Ok so I need a substitution for local player for more than one reason, I run into the issue when I use it to start a gui onTouch and I also run into the issue when I want to get the humans location so an aircraft holding vehicles can fly up forward then down to the npc's locaton with bodyposition and bodygyro. But for the gui insert script I also run into the problem that CameraSubject only works in test mode since the gui goes along with a cutscene.
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
26 Jun 2014 08:08 AM
Camera Subject is local only...
Report Abuse
1MangoMan0 is not online. 1MangoMan0
Joined: 28 Sep 2010
Total Posts: 1596
26 Jun 2014 10:02 AM
As far as I know, the only way to get a player's camera is from a LocalScript. Just check for a collision with the GUI block from a LocalScript, and check for the part's name to see if it was the correct brick, then do what you want with the camera.

As for the other things, we've already told you how to do them.
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
26 Jun 2014 11:40 AM
I know it's local only but it still doesent work. Idk why qq.
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
26 Jun 2014 11:40 AM
Ok i'll try again.
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
26 Jun 2014 04:05 PM
LocalPlayer still doesent work. In-Game, localscript or not.
Report Abuse
GearMechs is not online. GearMechs
Joined: 01 Dec 2010
Total Posts: 1220
26 Jun 2014 04:23 PM
If you can get the data from a StringValue and a script inside the player, then use a script inside the player to copy the stringvalue to the Game.
Report Abuse
GearMechs is not online. GearMechs
Joined: 01 Dec 2010
Total Posts: 1220
26 Jun 2014 04:26 PM
For Instance:
this goes in the player

Camera = Instance.new('StringValue', script.Parent)
Camera.Value = script.Parent.Camera.CameraSubject

String = Camera:Clone()
String.Parent = (Insert where you need the data here)
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
26 Jun 2014 09:32 PM
Ok i'll try that.
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
26 Jun 2014 09:40 PM
Oh wait. I would need to get the character for that, and localplayer only works in test mode.
OH! I have an idea. I'll get the parent on the onTouch(hit) to go inside the character.
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
26 Jun 2014 09:52 PM
Df?!!? Something went wrong. I know something went wrong when it kills me .-.
In "Part" in Workspace there is a Script with this code:
function onTouched(hit)
if hit.Parent.Humanoid ~= nil then
hit.Parent = Character
script.CameraScript.Disabled = false
g = script.CameraScript:clone()
g.Parent = Character
end
end
script.Parent.Touched:connect(onTouched)
Then in the Script in the Part there is a another script named "Camera Script" that has this code:
Camera = Instance.new('StringValue', script.Parent)
Camera.Value = script.Parent.Camera.CameraSubject
String = Camera:Clone()
String.Parent = Character
--I didnt think I needed to put a function in this one so why does this kill me?
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
26 Jun 2014 09:53 PM
Oh wait! I disabled it too early.
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
26 Jun 2014 09:54 PM
I mean enabled, and hopefully this works.
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
26 Jun 2014 09:57 PM
Didnt work. A little help?
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