How would I weld the player relative to my lift?

Hello there users of devforum. I have made this script for the players to get on the lift and start moving to a different direction. Though I got the tweening script done, the welding part of it doesn’t seem to work and just happens to leave the player behind. Im also encountering this second error of the lift just not moving at all for some reason. Ideas?

(editting for boost

script.Parent.Parent.real.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		local char = hit.Parent
		local RootPart = char:WaitForChild("HumanoidRootPart")
		local weld = Instance.new("WeldConstraint", workspace)	
		
		script.Parent.ClickDetector.MouseClick:Connect(function()
			if IsAtPos == false then
				IsAtPos = true
				local starttween = tweenservice:Create(realpart, infotween, tweenconfig)
				starttween:Play()
				weld.Part0 = RootPart
				weld.Part1 = script.Parent
			else
				IsAtPos = false
				local returntween = tweenservice:Create(realpart, infotween, tweenreturn)
				returntween:Play() 
				weld:Destroy()

I believe this may help: BasePart:SetNetworkOwner (roblox.com)

1 Like

I was asleep, but how would I use this in my scripts?

It didn’t seem to work it would either just attatch the lift to my players hrp.

hit:SetNetworkOwner(RootPart)

Or when I change it to char it’ll just leave the player behind.

You could use a local script for the elevator.

1 Like

Because you are using TweenService to move a part, no actual game physics are calculated and the player will not be moved. Use Forces/Constraints instead of TweenService.

1 Like