modifique esse script funcionar com todos os Models da workspace chamado "Porta" e use o…
- User
modifique esse script funcionar com todos os Models da workspace chamado "Porta" e use o eixo x de acordo com o numero da propriedade no marcador do model : local TweenService = game:GetService("TweenService")
local hinge = script.Parent.PrimaryPart local prompt = script.Parent.Base:FindFirstChildOfClass("ProximityPrompt") local Sound = nil
if script.Parent.Base:FindFirstChildOfClass("Sound") then Sound = script.Parent.Base:FindFirstChildOfClass("Sound") end
local goalOpen = {} goalOpen.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(90), 0)
local goalClose = {} goalClose.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0)
local tweenInfo = TweenInfo.new(1) local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen) local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose)
prompt.Triggered:Connect(function() prompt.Enabled = false if prompt.ActionText == "Fechar" then tweenClose:Play() prompt.ActionText = "Abrir" else tweenOpen:Play() prompt.ActionText = "Fechar" end if Sound ~= nil then Sound:Play() end wait(1) prompt.Enabled = true end)
- Assistant