Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to move every other players character except yours?

Asked by 3 years ago

Here's the basic move character script.

    local RunService = game:GetService("RunService")
    local Players = game:GetService("Players")

    local localPlayer = Players.LocalPlayer

    RunService:BindToRenderStep("move",
        -- run after the character
        Enum.RenderPriority.Character.Value + 1,
        function()
         if localPlayer.Character then
             local humanoid = localPlayer.Character:FindFirstChild("Humanoid")
             if humanoid then
                 humanoid:Move(Vector3.new(0, 0, -1), true)
             end
         end
        end
    )

Now what I want to do is make it so every other character except the local players character moves, how would I be able to accomplish this?

0
Do add a little more description to what you are trying to achieve. I don't understand what do you mean by moving the local player's character. As, if we look in universal view, every player's character is a "local player" character. So, according to the logic, none of the player and only NPC would move. Also, the script you provided is the complete opposite of what you are trying to achieve. BestCreativeBoy 1395 — 3y
0
What I mean by this is, when I activate the move, every other players character will move except my own until the move has stopped kegirosou 17 — 3y
0
For this, you have to use a Remote Event to fire to the server (as it can't be done on Local side) [Basic Way]. In that event, you can pass the name of your local player and then in your server side, you can create a table of all the players and remove the name of the local player, after that, you can use for loop (in spawn function[If you want to do it simultaneously]), and then move the humanoid BestCreativeBoy 1395 — 3y
0
But how would you store the playres into a table, then remove the localplayer from the table? kegirosou 17 — 3y
0
you use table.insert and table.remove. You can see how tables work here: https://developer.roblox.com/en-us/api-reference/lua-docs/table NGC4637 602 — 3y

Answer this question