Tween Elevator/Tween Service Trouble

Hello all! I am currently making an elevator with custom proximity prompts and tweeing. Everything works except for the tween. I get no errors at all. I have searched youtube and the forums to no avail… Here is the code:

– Server

local remote = game.ReplicatedStorage.CallElevator

local elevator = script.Parent.Parent
local lift = elevator.ElevatorModel
local platform = lift.Platform

local primary = lift.PrimaryPart

local TweenService = game:GetService("TweenService")
local info = TweenInfo.new(5, Enum.EasingStyle.Circular, Enum.EasingDirection.In, 0, false, 1)

local tween = TweenService:Create(primary, info, {CFrame = primary.CFrame * CFrame.new(primary.Size.Y + 0, 30.6, 0)})

remote.OnServerEvent:Connect(function(plr)
	tween:Play()
end)

Client

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local HRE = char:WaitForChild("HumanoidRootPart")

local UIS = game:GetService("UserInputService")

local elevator = workspace.Elevator
local Up = elevator:WaitForChild("ButtonUp").PromptPart
local Down = elevator:WaitForChild("ButtonDown").PromptPart

local holdingKey = false
local count = 3 -- Change this to how long the plr needs to hold the button

UIS.InputBegan:Connect(function(keycode)
	if keycode.KeyCode == Enum.KeyCode.E then
		if (Up.Position - HRE.Position).magnitude < 20 or (Down.Position - HRE.Position).magnitude < 20 then -- You can change 20 to be further if you want players to be able to be more away from the elevator
			holdingKey = true
			
			while holdingKey == true do
				count = count - 1
				print(count)
				task.wait(1)
				
				if count == 0 then
					game.ReplicatedStorage.CallElevator:FireServer()
					print(plr.Name)
					holdingKey = false
					count = 3 -- Change this to what you change the "count" variable too!
				end
			end
		end
	end
end)

UIS.InputEnded:Connect(function(keycode)
	if keycode.KeyCode == Enum.KeyCode.E then
		count = 3 -- Change this to what you change the "count" variable too!
		holdingKey = false
	end
end)
```

two questions:
is your event firing? you can just use a print statement to figure that out
and how does ur custom proximity system work?

1 Like

The event is firing. The custom proximity ptompt functionality is in the client script. it uses userinputservice

hm not sure if this matters but is there a part selected as the primary part within the model?

Yes there is, It is the platform of the elevator