Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 24 Oct 2012 05:12 PM |
I get no output and have been working on this for a while. I ran out of ideas to fix it so I decided to post it here. This is only part of the script, but I do not think the rest of it affects it, as the rest of it works. If you need me to post the rest, tell me, and I will. Here is the script:
v.Value = script.Parent.Parent.Parent.Parent.Name Player = game.Players.LocalPlayer Player.CharacterAdded:connect(function(character) if Player.Name == v.Value then Player.Character.Torso.CFrame = CFrame.new(script.Parent.Position) script.Parent:Remove() end end)
it sets the Value just fine, it just does not move the Player. What I want it to do is if the respawned player's name matches the Value of v, it moves the character to the parent of the script. I can't think of anything else to fix this. Can I have some help please? |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 24 Oct 2012 05:19 PM |
local v = script.Parent.Parent.Parent.Parent.Name game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function() if Player.Name == v then Player.Character:MoveTo(Vector3.new(script.Parent.Position)) script.Parent:Remove() end end) |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 24 Oct 2012 05:20 PM |
*
local v = script.Parent.Parent.Parent.Parent.Name game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function() if Player.Name == v then Player.Character:MoveTo(Vector3.new(script.Parent.Position)) script.Parent:Remove() end end) end) |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 24 Oct 2012 05:26 PM |
Oops, I posted that wrong, sorry. V was already defined.
v = Instance.new("StringValue") v.Value = script.Parent.Parent.Parent.Parent.Name Player = game.Players.LocalPlayer Player.CharacterAdded:connect(function(character) if Player.Name == v.Value then Player.Character.Torso.CFrame = CFrame.new(script.Parent.Position) script.Parent:Remove() end end)
|
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 24 Oct 2012 05:35 PM |
local v = Instance.new("StringValue") local c = script.Parent.Parent.Parent.Parent.Name v.Value = c game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function() if Player.Name == c then Player.Character:MoveTo(Vector3.new(script.Parent.Position)) script.Parent:Remove() end end) end)
me thinks. |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 25 Oct 2012 09:23 PM |
| Nope, that didn't work either. :S |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2012 09:26 PM |
Never parented v and it runs before the character is created
local v = Instance.new("StringValue", workspace) local c = script.Parent.Parent.Parent.Parent.Name v.Value = c game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function() Player.CharacterAdded:wait() if Player.Name == v then Player.Character:MoveTo(Vector3.new(script.Parent.Position)) script.Parent:Remove() end end) end) |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2012 09:43 PM |
| @death, 2 Characters added before it fires. .-. |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 25 Oct 2012 09:43 PM |
Here is the full code, it may be affecting it:
s = Instance.new("Smoke") v = Instance.new("StringValue") function Equipped() if script.Parent.Parent.Parent.Parent.ClassName == "Player" then v.Parent = script.Parent v.Value = script.Parent.Parent.Parent.Parent.Name
end end
script.Parent.Parent.Equipped:connect(Equipped) script.Parent.Parent.Unequipped:connect(Equipped)
function onButton1Down(mouse) local p = Game.Players.LocalPlayer local m = p:GetMouse() script.Parent.Position = Vector3.new(m.Hit) script.Parent.Parent.Parent = game.Workspace script.Parent.Anchored = true script.Parent.CanCollide = true script.Parent.Parent = game.Workspace game.Workspace.TacticalInsertion:Remove() s.Parent = script.Parent s.Opacity = 0.2 s.RiseVelocity = 1 s.Size = 1 s.Color = Color3.new(0, 128, 0) end script.Parent.Parent.Equipped:connect(function(m) m.Button1Down:connect(onButton1Down)end) -- Stops working under this line I think
Player = game.Players.LocalPlayer game.Players.PlayerAdded:connect(function(Player) if Player.Name == v.Value then Player.Character.Torso.CFrame = CFrame.new(script.Parent.Position) script.Parent:Remove() end end) |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
|
| 26 Oct 2012 02:18 AM |
Umm doesnt it need to go to game.workspace,nt,.workspace!
|
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
|
| 27 Oct 2012 08:02 PM |
| hi i need help with scripting could u help me script just tell me everything i need to know about scripting and i will pay u any robux u name it plz just tell me how |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 27 Oct 2012 08:10 PM |
Um...
Wiki
lolololololol
But seriously, can I have some help?? I want to finish this so I can move on... |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 27 Oct 2012 11:14 PM |
| And another bump, in the hopes that someone can tell me what I'm doing wrong with this script... |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 29 Oct 2012 03:38 PM |
| Bump.............................. |
|
|
| Report Abuse |
|
|
|
| 29 Oct 2012 03:48 PM |
try this
repeat wait() until game.Players.LocalPlayer local p = Game.Players.LocalPlayer local m = p:GetMouse()
s = Instance.new("Smoke") v = Instance.new("StringValue") function Equipped() if script.Parent.Parent.Parent.Parent.ClassName == "Player" then v.Parent = script.Parent v.Value = script.Parent.Parent.Parent.Parent.Name
end end
script.Parent.Parent.Equipped:connect(Equipped) script.Parent.Parent.Unequipped:connect(Equipped)
function onButton1Down(mouse) script.Parent.Position = Vector3.new(m.Hit) script.Parent.Parent.Parent = game.Workspace script.Parent.Anchored = true script.Parent.CanCollide = true script.Parent.Parent = game.Workspace game.Workspace.TacticalInsertion:Remove() s.Parent = script.Parent s.Opacity = 0.2 s.RiseVelocity = 1 s.Size = 1 s.Color = Color3.new(0, 128, 0) end script.Parent.Parent.Equipped:connect(function(m) m.Button1Down:connect(onButton1Down)end) -- Stops working under this line I think
Player = game.Players.LocalPlayer game.Players.PlayerAdded:connect(function(Player) if Player.Name == v.Value then Player.Character.Torso.CFrame = CFrame.new(script.Parent.Position) script.Parent:Remove() end end) |
|
|
| Report Abuse |
|
|
|
| 29 Oct 2012 03:50 PM |
*
repeat wait() until game.Players.LocalPlayer local p = Game.Players.LocalPlayer local m = p:GetMouse()
s = Instance.new("Smoke") v = Instance.new("StringValue") function Equipped() if script.Parent.Parent.Parent.Parent.ClassName == "Player" then v.Parent = script.Parent v.Value = script.Parent.Parent.Parent.Parent.Name
end end
script.Parent.Parent.Equipped:connect(Equipped) script.Parent.Parent.Unequipped:connect(Equipped)
function onButton1Down(mouse) script.Parent.Position = Vector3.new(m.Hit) script.Parent.Parent.Parent = game.Workspace script.Parent.Anchored = true script.Parent.CanCollide = true script.Parent.Parent = game.Workspace game.Workspace.TacticalInsertion:Remove() s.Parent = script.Parent s.Opacity = 0.2 s.RiseVelocity = 1 s.Size = 1 s.Color = Color3.new(0, 128, 0) end
Player = game.Players.LocalPlayer game.Players.PlayerAdded:connect(function(Player) if Player.Name == v.Value then Player.Character.Torso.CFrame = CFrame.new(script.Parent.Position) script.Parent:Remove() end end)
script.Parent.Parent.Equipped:connect(function(m) m.Button1Down:connect(onButton1Down)end) |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
|
| 31 Oct 2012 02:31 PM |
| Are there any errors outputting? If so what are they? |
|
|
| Report Abuse |
|
|