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.
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
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.