I’ve been trying to create a simple elevator script using the new proximity prompts, though I’ve run in to some issues.
When changing the rootParts position all prompts seem to completely break.
I’ve stripped down my code to be as simple as possible and I still cannot see what the problem is. I have tested the same code in another place and it seemed to work fine.
Elevator Code
script.Parent.UpperShaft.Trigger.ProximityPrompt.Triggered:Connect(function(plr)
plr.Character.HumanoidRootPart.Position = plr.Character.HumanoidRootPart.Position - Vector3.new(0, 24, 0)
end)
script.Parent.LowerShaft.Trigger.ProximityPrompt.Triggered:Connect(function(plr)
plr.Character.HumanoidRootPart.Position = plr.Character.HumanoidRootPart.Position + Vector3.new(0, 24, 0)
end)
Door Script
local Tween = game:GetService("TweenService")
local D1 = script.Parent.Parent.Door1
local D2 = script.Parent.Parent.Door2
local Button = script.Parent
Button.ProximityPrompt.Triggered:Connect(function()
Button.ProximityPrompt.Enabled = false
Tween:Create(D1, TweenInfo.new(.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out),{Position = D1.Position - D1.CFrame.LookVector*2}):Play()
Tween:Create(D2, TweenInfo.new(.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out),{Position = D2.Position + D2.CFrame.LookVector*2}):Play()
Button.Sound:Play()
wait(2)
Tween:Create(D1, TweenInfo.new(.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out),{Position = D1.Position + D1.CFrame.LookVector*2}):Play()
Tween:Create(D2, TweenInfo.new(.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out),{Position = D2.Position - D2.CFrame.LookVector*2}):Play()
Button.Sound:Play()
wait(.5)
Button.ProximityPrompt.Enabled = true
end)