of     1   

ZBoyer1000
#168923019Sunday, July 26, 2015 11:51 PM GMT

I'm trying to make a localscript that moves a named model with a humanoid that walks to Vector3.new(0,0,9000) on a push of a button. Ex. "1000ZBoyer (Player2)" The First part of the name will be the player's name. Ex. 1000ZBoyer I need some help to make this work properly. local mouse = game.Players.LocalPlayer:GetMouse() mouse.KeyDown:connect(function (key) for i, v in pairs(game.Players:GetChildren()) do if key == "w" then local nam = script.Parent.Parent.Character.Name.." (Player2)" game.Workspace.FindFirstChild(nam).Humanoid.WalkToPoint = Vector3.new(0,0,9000) end mouse.KeyUp:connect(function (key) if key == "w" then local nam = script.Parent.Parent.Character.Name.." (Player2)" game.Workspace.nam.Humanoid.WalkToPoint = game.Workspace.nam.Torso.Position end end) end end)
phoenix53124
#168923403Sunday, July 26, 2015 11:53 PM GMT

I'd recommend a reference name (taking the initial name and storing it for later), because what that will do is just tack " (Player2)" on the end of whatever is already there, resulting in something like "Character (Player2) (Player2) (Player2) (Player2)" local NameReference = script.Parent.Name local add = " (Player)" script.Parent.Name = NameReference..add
ZBoyer1000
#168924127Sunday, July 26, 2015 11:59 PM GMT

That might help. :)
ZBoyer1000
#168927139Monday, July 27, 2015 12:26 AM GMT

I'm trying to move a model in the Workspace with the player's name and " (Player2)" Ex: "Player name here (Player2)" I can't seem to get this to work. local mouse = game.Players.LocalPlayer:GetMouse() mouse.KeyDown:connect(function (key) for i, v in pairs(game.Players:GetChildren()) do if key == "w" then local NameReference = script.Parent.Parent.Character.Name local add = " (Player2)" local ds = NameReference..add game.Workspace.ds.Humanoid.WalkToPoint = Vector3.new(0,0,9000*9000*9000) end mouse.KeyUp:connect(function (key) if key == "w" then local NameReference = script.Parent.Parent.Character.Name local add = " (Player2)" local ds = NameReference..add game.Workspace.ds.Humanoid.WalkToPoint = game.Workspace.nam.Torso.Position end end) end end)

    of     1