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 » Scripters
Home Search
 

Re: Why won't this work?

Previous Thread :: Next Thread 
madman5533 is not online. madman5533
Joined: 12 Mar 2009
Total Posts: 181
09 Jul 2015 09:52 PM
I have a part that is suppose to follow an object and it worked until i changed it's target to my player in edit mode, how do i do this line right?...



local rp=Instance.new("RocketPropulsion")
rp.Parent=workspace.Part
rp.MaxSpeed=10
rp.Target=game.Workspace.Player <-------This is the trouble line
rp:fire()
Report Abuse
madman5533 is not online. madman5533
Joined: 12 Mar 2009
Total Posts: 181
09 Jul 2015 09:57 PM
Did everyone take a vacation day today or something?
Report Abuse
colinrules10 is not online. colinrules10
Joined: 04 May 2013
Total Posts: 878
09 Jul 2015 10:01 PM
patients.
Report Abuse
MKofOrbiter is not online. MKofOrbiter
Joined: 28 Aug 2010
Total Posts: 910
09 Jul 2015 10:02 PM

One this script will only work in studio or you get someone to play named Player.


I don't use RocketPropulsion but It may be because the Player has no Position because it a Model.

Try Player.Torso
Report Abuse
SpazzMan502 is not online. SpazzMan502
Joined: 01 Aug 2013
Total Posts: 2397
09 Jul 2015 10:02 PM
I'm not completely sure, but maybe the target can't be a model, player is a model.

So do

rp.Target=game.Workspace.Player.Torso



BUT WAIT.

This script will only work for people named "Player"

In order to make it work for any player name, you have to probably do some things in a localscript using player.Character.Torso , etc.

If you need me to help, just message me with the model

For now this will only work in studio



Also, try using scripting helpers, a website based for help on roblox scripting
It's really helpful.



RIP Yolo Sombrero
Report Abuse
madman5533 is not online. madman5533
Joined: 12 Mar 2009
Total Posts: 181
09 Jul 2015 10:04 PM
Yes, i know of scripting helpers, i go on there all the time
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
09 Jul 2015 10:05 PM
"patients"

I lol'd.

@OP
Not everyone is named, "Player"

You need to go to game.Players and then find a player, from there, you can go (Player).Character.Torso to retrieve the Torso.

http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting
Report Abuse
madman5533 is not online. madman5533
Joined: 12 Mar 2009
Total Posts: 181
09 Jul 2015 10:06 PM
It still doesn't work using {game.Workspace.Player.Torso}
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
09 Jul 2015 10:08 PM
*Sigh*

Are you trying to test this in online mode?
Report Abuse
madman5533 is not online. madman5533
Joined: 12 Mar 2009
Total Posts: 181
09 Jul 2015 10:09 PM
idk, i clicked the one beside when you play the game
Report Abuse
SpazzMan502 is not online. SpazzMan502
Joined: 01 Aug 2013
Total Posts: 2397
09 Jul 2015 10:09 PM
What does the output say?

Go to studio - View - and click on output. It shows everything wrong with scripts in red



RIP Yolo Sombrero
Report Abuse
madman5533 is not online. madman5533
Joined: 12 Mar 2009
Total Posts: 181
09 Jul 2015 10:10 PM
--Player is not a valid member of Workspace
Report Abuse
madman5533 is not online. madman5533
Joined: 12 Mar 2009
Total Posts: 181
09 Jul 2015 10:15 PM
Hello
Report Abuse
madman5533 is not online. madman5533
Joined: 12 Mar 2009
Total Posts: 181
09 Jul 2015 10:21 PM
Here is my script once again, put this inside a Part in a script and plz find out the problem

local rp=Instance.new("RocketPropulsion")
rp.Parent=workspace.Part
rp.MaxSpeed=10
rp.Target=game.Workspace.Player <-------This is the trouble line
rp:fire()
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
09 Jul 2015 10:21 PM
Hello, please read this:

http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting

Check out a few more tutorials, and tell us if you're ready to read the replies explaining why you need to access the Dharacter through the Player object in game.Players rather than indexing it through Workspace directly.

1) "This script will only work for people named "Player"

In order to make it work for any player name, you have to probably do some things in a localscript using player.Character.Torso , etc."

2) "One this script will only work in studio or you get someone to play named Player."

3) "@OP
Not everyone is named, "Player"

You need to go to game.Players and then find a player, from there, you can go (Player).Character.Torso to retrieve the Torso."
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
09 Jul 2015 10:22 PM
access the Character*
Report Abuse
madman5533 is not online. madman5533
Joined: 12 Mar 2009
Total Posts: 181
09 Jul 2015 10:28 PM
Yes, Yes, Yes, i know all of this stuff, i'm not a beginner. I've already tried that and it did not work, if you don't believe me then test it out your self.
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
09 Jul 2015 10:32 PM
rp.Target=game.Players:GetPlayers()[1].Character.Torso
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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