|
| 25 Jul 2013 02:48 PM |
Hey, I have this script and everything works fine besides changing the character's position. I test this in a server, not using Play Solo, so there is no output.
game.Players.PlayerAdded:connect(function(player) local leaderstats = Instance.new("Model", player) leaderstats.Name = "leaderstats" local money = Instance.new("IntValue", leaderstats) money.Name = "Stage" money.Value = 1 player.CharacterAdded:connect(function(character) if character:FindFirstChild("Torso") then --Not necessary, used for testing. character.Torso.CFrame = CFrame.new(Vector3.new(0,3,0) + game.Workspace.Spawns:FindFirstChild(money.Value).Position) end end) end)
--You may realize that I used both CFrame and Vector3. This is because I've used the pattern before in different scripts, and it works fine.
*Tell me about the rabbits, George* |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 02:51 PM |
character.Torso.CFrame = CFrame.new(0,3,0) * game.Workspace.Spawns.money.Value.CFrame
Umm....
Please tell me what is a part and intvalue and etc for further help |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 02:55 PM |
Ah sorry I forgot to add that part.
In player: Player->leaderstats (model defined as leaderstats)-> Stage (IntValue defined as money) In Workspace: Workspace->Spawns->Parts that are named as numbers (corresponding to money.Value)
*Tell me about the rabbits, George* |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 02:57 PM |
The idea is to teleport the character to the Part in Spawns whose name is equal to the player's money.Value when the character respawns.
*Tell me about the rabbits, George* |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 03:02 PM |
Which axis are you trying to add onto the Character's torso?
eg:
.Blah.CFrame = CFrame.new(0,3,0) * CFrame.new(0,money.value,0) or
.Blah.CFrame = CFrame.new(0,3,0) * CFrame.new(money.value,0,0)
or
.Blah.CFrame = CFrame.new(0,3,0) * CFrame.new(0,0,money.value)
|
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 03:06 PM |
no,no I have no problem with the CFrame part, I understand how that works. I am having trouble relating it to the Part in model Spawns that has the same name as money.Value.
game.Workspace.Spawns:FindFirstChild(money.Value) --That is the problem. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 03:10 PM |
That'd be;
game.Workspace.Spawns:FindFirstChild("money").Value
Make sure you use the correct capitalization. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 03:13 PM |
Right, but I'm not looking for money, I'm looking for the part whose name is the equivalent of money.Value so I have game.Workspace.Spawns:FindFirstChild(money.Value) because it should find the part in spawns with name money.Value, which is 1. However, that line is not working too well for me. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 03:26 PM |
Bump. This thing has really got me stumped.
|
|
|
| Report Abuse |
|
|