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 » Scripting Helpers
Home Search
 

Re: I do not understand why this does not work.

Previous Thread :: Next Thread 
Zkiller11 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
25 Oct 2012 09:23 PM
Nope, that didn't work either. :S
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
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
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
25 Oct 2012 09:43 PM
@death, 2 Characters added before it fires. .-.
Report Abuse
Zkiller11 is not online. 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 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
25 Oct 2012 11:22 PM
Bump..
Report Abuse
NiceCake123 is not online. NiceCake123
Joined: 24 Dec 2011
Total Posts: 972
26 Oct 2012 02:18 AM
Umm doesnt it need to go to game.workspace,nt,.workspace!
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
26 Oct 2012 04:03 PM
Er, what?
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
26 Oct 2012 08:35 PM
Bump.
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
27 Oct 2012 07:42 PM
Bump..
Report Abuse
smartkitty12345 is not online. smartkitty12345
Joined: 06 Jul 2012
Total Posts: 3
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 is not online. 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 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
27 Oct 2012 10:33 PM
I'd really like help...
Report Abuse
Zkiller11 is not online. 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 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
28 Oct 2012 04:11 PM
Bump...........
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
29 Oct 2012 03:04 PM
.....

Bump..

.....
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
29 Oct 2012 03:38 PM
Bump..............................
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
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
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
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 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
31 Oct 2012 01:59 PM
Nope D:
Report Abuse
coldmillionare is not online. coldmillionare
Joined: 13 Feb 2010
Total Posts: 10560
31 Oct 2012 02:31 PM
Are there any errors outputting? If so what are they?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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