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

How would i check the Y difference between the player and the baseplate? eeeeeeeeeeeeee

Asked by 3 years ago
Edited 3 years ago

I'm making a wall hopping game 2000 studs and i want to let the player know how many studs the player is above the baseplate;

The problem is i only want it to change on the Y axis :/

local TextLabel = script.Parent

local Player = game.Players.LocalPlayer
local RunService = game:GetService("RunService")
wait(2)
local Character = Player.Character
local LeftLeg = Character["Left Leg"]

while RunService.RenderStepped:Wait() do
    local dist = (workspace.Baseplate.Position - LeftLeg.Position).Magnitude.Y

    print(dist)
    TextLabel.Text = "Height: " .. tostring(math.floor(dist)) .. "Studs"
end

1 answer

Log in to vote
0
Answered by
imKirda 4491 Moderation Voter Community Moderator
3 years ago

You can try this:

local distance = (part.Position.Y - baseplate.Position.Y)
print(distance)
Ad

Answer this question