|
| 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 |
|
|
|
| 09 Jul 2015 09:57 PM |
| Did everyone take a vacation day today or something? |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 09 Jul 2015 10:04 PM |
| Yes, i know of scripting helpers, i go on there all the time |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 09 Jul 2015 10:06 PM |
| It still doesn't work using {game.Workspace.Player.Torso} |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2015 10:08 PM |
*Sigh*
Are you trying to test this in online mode? |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2015 10:09 PM |
| idk, i clicked the one beside when you play the game |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 09 Jul 2015 10:10 PM |
| --Player is not a valid member of Workspace |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 09 Jul 2015 10:32 PM |
| rp.Target=game.Players:GetPlayers()[1].Character.Torso |
|
|
| Report Abuse |
|
|