Tween Elevator Character Problem

I want to make elevator with tweaning service
2. What is the issue? Include screenshots / videos if possible!
Issue is that player can see each other fine, but server has bug with it, character is stuck away. I mean character is near elevator start and hummanoid root is on bottom of elevator fine.

Before use on server

After use on server

I tried welding of parts and grouping parts, but it didin’t work.

local TweeningService = game:GetService("TweenService")
local teleporterData = script.Parent.TeleporterData.Value
wait(1)


local partChanges = {
	--Size = Vector3.new(15,15,15),
	Position = teleporterData.DecoArea.Position, --Vector3.new(-188.15, 30.5, -14.001)
	Orientation = teleporterData.DecoArea.Orientation
}
local TweenInformation = TweenInfo.new(
	3, -- Time
	Enum.EasingStyle.Linear, -- Easing Style
	Enum.EasingDirection.Out, -- Easing Direction
	0, -- RepeatCount
	false, -- Reverse?
	0 -- DelayTime	(For Loop)			
)
--local elevatorParts = {script.Parent,script.Parent.PlatformWindow}

script.Parent.Event.OnServerEvent:connect(function(Player)
	local Mag = (script.Parent.Position-Player.Character.PrimaryPart.Position).magnitude
	if Mag <= script.Parent.Range.Value then
		if Player.Character.PrimaryPart:FindFirstChild("ElevatorDB")==nil then
			local db = Instance.new("BoolValue",Player.Character.PrimaryPart)
			db.Name = "ElevatorDB"
			Player.Character.PrimaryPart.Anchored=true
			local tween = TweeningService:Create(Player.Character.PrimaryPart,TweenInformation,partChanges)
			tween:Play()
			repeat wait() until tween.Completed:wait()
			Player.Character.PrimaryPart.Anchored=false
			db:remove()
		end
	end
end)
1 Like

Try welding the player to the elevator and breaking the weld after the elevator has finished it’s tween.

Elevator is not moving. it moves player using humanoidrootpart

EDIT \/
It moves player on E click - client side script

You said client side… Do you have an event that fires when the player clicks E so the server can run the function?

It is Event named Event parented to parent of script.

Found answer on this topic

Just saying, :connect is deprecated so try to use :Connect more often. :slight_smile:

ok, just typed this becose I found answer to this.