I wanted to fling all the players in the game, but all the script does is puts the player in platformstand. I put the script in serverscriptservice which I am not sure about. The script goes:
local players = game.Players:GetPlayers()
for i,v in pairs(players) do
v.Character.HumanoidRootPart.Velocity = Vector3.new(1500,1000,0)
v.Character.Humanoid.PlatformStand = true
end
Hope you understood. I think the mistake is the parent of the script. Please help. Thanks!
The player will not move if they don’t have a network ownership of nil. You can easily prevent this if you create something like a BodyVelocity or a LinearVelocity to move the character.
Your fling script might break if someone is missing a character or a humanoidrootpart. Make sure you check to make sure they have one.
Example:
local Players = game.Players:GetPlayers()
for _, Player in pairs(Players) do
local Character = Player.Character
if not Character then
continue
end
local Root = Character:FindFirstChild("HumanoidRootPart")
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
if not Root or not Humanoid then
continue
end
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.Velocity = Vector3.new(1500, 1500, 0)
BodyVelocity.MaxForce = Vector3.one * math.huge
BodyVelocity.Parent = Root
Humanoid.PlatformStand = true
end