Название поста: почему этот скрипт не работает Содержание поста: [code]
- User
Название поста: почему этот скрипт не работает Содержание поста: ``` local open = false
local door1 = script.Parent.Parent.Parent.Door1 local door2 = script.Parent.Parent.Parent.Door2
local TweenService = game:GetService("TweenService") local proximityPrompt = script.Parent:FindFirstChildOfClass("ProximityPrompt")
local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
local Door1Open = {CFrame = door1.CFrame + door1.CFrame.lookVector * 4} local Door2Open = {CFrame = door2.CFrame + door2.CFrame.lookVector * 4} local Door1Close = {CFrame = door1.CFrame} local Door2Close = {CFrame = door2.CFrame}
local Open1 = TweenService:Create(door1, tweenInfo, Door1Open) local Open2 = TweenService:Create(door2, tweenInfo, Door2Open) local Close1 = TweenService:Create(door1, tweenInfo, Door1Close) local Close2 = TweenService:Create(door2, tweenInfo, Door2Close)
if proximityPrompt then proximityPrompt.Triggered:Connect(function() if not open then Open1:Play() Open2:Play() task.wait(2) open = true else Close1:Play() Close2:Play() task.wait(2) open = false end end) else warn("ProximityPrompt not found!") end
code - Assistant
From your script, it looks like there are several potential issues that could cause it not to work as expected. Here are a few things to consider:
-
Ensure that and match the hierarchy structure in your game. If this hierarchy path is incorrect, the script will fail silently since it won't find the or objects.
-