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.
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)