Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

1 Line'd script, someone fix it?

I'm trying to make a teleport/all/me script. But It wont teleport. Here is the code; so I want to make it so all of them teleport to where my torso is, but can i do this?

v.Character.Torso.Position = Vector3.new(game.Workspace.0x72) --ignore the red line on studio, my name does that.

2 answers

Given that everything is defined and you've made sure it won't break(in case you're not in the game or not every player has a torso or whatever), this line should work.

v.Character.Torso.Position = Workspace['0x72'].Torso.Position

1 comment

0

Its possible to do that, but make it teleport to a part? so a=Instance.new("Part",Workspace) v.Character.Torso.Position = Workspace['Part']

Like what Verified said, for you personally, when you index yourself you'll have to use square brackets and quotes since the first character of your username is a number, which isn't valid syntax in Lua. I think you might be under the impression that just using the variable v applies the line to everyone. I recommend reading about Loops. What you're trying to do could be accomplished by this.

for _, v in pairs(Game:GetService("Players"):GetPlayers()) do
	v.Character.Torso.CFrame = CFrame.new(Workspace["0x72"].Torso.Position)
end
-- Keep in mind that if either you or another player's character doesn't exist at the time this script executes, an error will be thrown.

1 comment

0

ty for the answer, my command still doesn't work :/

This discussion is preserved as it was. New answers, comments, and votes are closed.