#how isnt there "Position" inside player model properties itself??

1 messages · Page 1 of 1 (latest)

uncut lion
#
local module = {}

local Players = game:GetService("Players")
function module.Trigger()
    for _, player in Players:GetPlayers() do
        local char = player.Character or player.CharacterAdded:Wait()
        local humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
        local humanoid = char:FindFirstChild("Humanoid")
        if char then
            local lastPos = char.Position
            wait(1)
            char:MoveTo(9, -169, -171)
            workspace["647"].Playing = true
            wait(60)
            char:MoveTo(lastPos)
        end
    end
end

return module

Output:

warped shore
#

models dont have a position local lastPos = char.Position but it does have a few other options you could use instead, try one of those maybe

uncut lion
#

what

warped shore
#

or go by the hrp position, which is what the model uses anyway

uncut lion
#

i literally can see "Position" inside player model wdym

warped shore
#

that's not position

uncut lion
#

look

warped shore
#

yeah i see no position

#

i see origin and worldpivot, but no position to be seen there

uncut lion
#

what

#

...

#

are u referring to Position thats inside Origin?

warped shore
#

tbh parts dont have position either they have cframe, but roblox added position for convenience and it has a specific behavior with welds that can be handy sometimes

warped shore
#

iirc origin isn't scriptable

uncut lion
#

ok

#

better? local lastPos = char.WorldPivot.Position

warped shore
#

you can always check this stuff in the docs fingerguns

uncut lion
#

nah i used WorldPivot

#

lemme test

#

bruh time to find out

#

changed it

#

what

#

it just teleported me outside the map completley, not inside the hall

#

the player character is 2007 roblox character

warped shore
#

and your position may be wrong 🤷

uncut lion
#
local module = {}

local Players = game:GetService("Players")
function module.Trigger()
    for _, player in Players:GetPlayers() do
        local char = player.Character or player.CharacterAdded:Wait()
        local humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
        local humanoid = char:FindFirstChild("Humanoid")
        if char then
            local lastPos = char.WorldPivot.Position
            wait(1)
            char:MoveTo(Vector3.new(9, -169, -171))
            workspace["647"].Playing = true
            wait(60)
            char:MoveTo(lastPos)
        end
    end
end

return module```
#

is there a problem with Vector3

warped shore
#

idk it depends on your map maybe you got the coordinates wrong and it's supposed to be -9,169,171 idk

uncut lion
#

lemme check the hallway position

warped shore
#

or some other numbers entirely who knows 🤷

uncut lion
#

i dont think i mistyped the position

#

the position is directly inside the hall

warped shore
#

then probably fine

#

when you get there, look up coz u probably fall out of the map idk

uncut lion
#

but why does it teleport me outside the map

warped shore
#

or anchor the player and manually check where they get teleported to

#

like add hrp.anchored=true to the teleport code so you can check

uncut lion
#

it just tped me to this

#

that black rectangle is the hallway

warped shore
#

set the hrp cframe instead of using model:moveto

uncut lion
#

ok

#
local module = {}

local Players = game:GetService("Players")
function module.Trigger()
    for _, player in Players:GetPlayers() do
        local char = player.Character or player.CharacterAdded:Wait()
        local humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
        local humanoid = char:FindFirstChild("Humanoid")
        if char then
            local lastPos = char.WorldPivot.Position
            wait(1)
            char.WorldPivot.Position = Vector3.new(9.049, -171.3, -168.83)
            workspace["647"].Playing = true
            wait(60)
            char.WorldPivot.Position = Vector3.new(lastPos)
        end
    end
end

return module
rapid canyonBOT
#

studio** You are now Level 10! **studio

uncut lion
#

i changed things

#

instead of MoveTo, it will set worldpivot.position of character

warped shore
uncut lion
#

bro i have not put any "CFrame"

warped shore
uncut lion
#

i just put WorldPivot, is WorldPivot same as CFrame?

warped shore
uncut lion
warped shore
#

sometimes the model's worldpivot is not the same as where the parts are, i'm guessing thats why you teleported so far, looks double the distance from 0,0,0 so, yea

#

You can learn a lot by reading the docs

This property determines where the pivot of a Model which does not have a set Model.PrimaryPart is located. If the Model does have a PrimaryPart, the pivot of the Model is equal to the pivot of that primary part instead, and this WorldPivot property is ignored.

For a newly created Model, its pivot will be treated as the center of the bounding box of its contents until the first time its Model.WorldPivot property is set. Once the world pivot is set for the first time, it is impossible to restore this initial behavior.

Most commonly, moving the model with the Studio tools, or with model movement functions such as PVInstance:PivotTo() and Model:MoveTo(), will set the world pivot and thus end this new model behavior.

The purpose of this behavior is to allow Luau code to get a sensible pivot simply by creating a new model and parenting objects to it, avoiding the need to explicitly set Model.WorldPivot every time you create a model in code.

uncut lion
#

how is that a nil?

#

i literally put a position

warped shore
#

show this line 12

uncut lion
#
local module = {}

local Players = game:GetService("Players")
function module.Trigger()
    for _, player in Players:GetPlayers() do
        local char = player.Character or player.CharacterAdded:Wait()
        local humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
        local humanoid = char:FindFirstChild("Humanoid")
        if char then
            local lastPos = char.WorldPivot.Position
            wait(1)
            humanoidRootPart.CFrame = Vector3.new(9.049, -171.3, -168.83)
            workspace["647"].Playing = true
            wait(60)
            humanoidRootPart.CFrame = Vector3.new(lastPos)
        end
    end
end

return module
warped shore
#

and the models don't have a primarypart either

uncut lion
warped shore
#

yea

uncut lion
#

wait i wanna see what happens if i try to change Humanoid's position

warped shore
#

no hrp in there 👍

uncut lion
#

ok

#

what

#

there wasnt any bad words

warped shore
uncut lion
#

uhm, i changed "head"'s position and what, okay lemme try to change the model's position.

warped shore
uncut lion
#

a

#

i changed worldpivot position and nothing happens

warped shore
# uncut lion a

it's literally all there in the docs

When setting this property any Welds or Motor6Ds connected to this part will have the matching C0 or C1 property updated and to allow the part to move relative to any other parts it is joined to.

WeldConstraints will also be temporarily disabled and re-enabled during the move.

uncut lion
#

i changed CFrame position and same thing

uncut lion
#
local module = {}

local Players = game:GetService("Players")
function module.Trigger()
    for _, player in Players:GetPlayers() do
        local char = player.Character or player.CharacterAdded:Wait()
        local humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
        local humanoid = char:FindFirstChild("Humanoid")
        if char then
            local lastPos = char.WorldPivot.Position
            wait(1)
            char:PivotTo(Vector3.new(9.049, -171.3, -168.83)) -- here
            workspace["647"].Playing = true
            wait(60)
            char:PivotTo(Vector3.new(lastPos))
        end
    end
end

return module
#

any idea on how to fix this one?

finite prawn
#

Y'all doing some backwards stuff

#

PivotTo requires a CFrame, not a vector

#

Pass the vector to CFrame.new

uncut lion
#

so do i use CFrame.new-

#

a

finite prawn
#

Use GetPivot().Position over world picot

uncut lion
#

ok

#

better?

local module = {}

local Players = game:GetService("Players")
function module.Trigger()
    for _, player in Players:GetPlayers() do
        local char = player.Character or player.CharacterAdded:Wait()
        local humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
        local humanoid = char:FindFirstChild("Humanoid")
        if char then
            local lastPos = char:GetPivot().Position
            wait(1)
            char:PivotTo(CFrame.new(9.049, -171.3, -168.83))
            workspace["647"].Playing = true
            wait(60)
            char:PivotTo(CFrame.new(lastPos))
        end
    end
end

return module
#

it teleported me outside the map, and the position is inside the hallway

#

what if i do anchor = true before teleporting then false after teleporting

#

and theres no anchor inside character model

#

and if i go to different part of map, i get teleported differently

#

@finite prawn (sry for ping) Any idea on how to fix that one?

worthy warren
uncut lion
#

pass vector to CFrame.new

#

i used that then its working but it teleports me in wrong position, and i put the position correctly

worthy warren
uncut lion
#

alr lemme use

#

...

#

but PivotTo already uses CFrame.new

worthy warren
uncut lion
#

but why teleport me outside the map

#

instead of inside the hallway

#

i put position correctly

worthy warren
uncut lion
#

yeah

#

just look

#

i put part inside the hallway then copied its position then pasted it in code

#

then when it teleports me, it just teleported me outside the map instead

dry carbon
#

you can use this

PlayerModel:GetBoundingBox().Position