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

Would this work?

for k,v in pairs(game.Players:GetPlayers())
    v:Players.Character.Torso.BodyVelocity.maxForce.Vector3.new(0, 15000, 0)
game.Players.Character.Torso.BodyPosition.Vector3.new(0, 5, 0)
         end
end

Would this code make me hover at a constant height of 5 studs, even when off of a platform? If not, how would I go about fixing it so that its ONLY me hovering?

1 comment

0

I'm asking this question because I'm VERY inexperienced with BodyVelocity and BodyPosition.

1 answer

✓ Accepted answer

Hey, Mushr0om :D

It would not work for a couple of reasons:

*Character is not a valid member of Players, it's a valid member of A player. *That is not how you index v in an in pairs for loop *You forgot "do" in your for loop

Here's a revised version:

for k,v in pairs (game.Players:GetPlayers ()) do 
	v.Character.Torso.BodyVelocity.maxForce = Vector3.new (0,15000,0) -- how to define a value
	v.Character.Torso.BodyPosition = Vector3.new (0,5,0) -- something seems missing on this line
end -- only need one end

This may not work because of line 4. It seems there's a value inside BodyPosition to do it, but I'm not an expert on BodyObjects either, so I wouldn't know it.

2 comments

0

How would I do it for only MY character?

0

Even simpler. Workspace.MUSHR0OM.Torso.BodyVelocity.maxForce = Vector3.new (0,15000,0) Workspace.MUSHR0OM.Torso.BodyPosition = Vector3.new (0,5,0)

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