im just trying to follow this guy’s suggested script but there are multiple problems occuring, one of which is proximitypromptservice.game:getservice? or i dont know which had broken everything that uses proximityprompt.
https://devforum.roblox.com/t/im-tryna-make-a-roller-curtain-blind-anyone-can-aid-me-on-it/3591416/17
script originated from
adding this issue as well
and here is the script for the roller blind:
local proximityPromptService = game:GetService('ProximityPromptService')
local tweenService = game:GetService('TweenService')
local TARGET_SIZE_Y = 0.5
local TWEEN_DURATION = 1
proximityPromptService.PromptTriggered:Connect(function(prompt: ProximityPrompt)
local blind = prompt.Parent
if not blind:IsA('BasePart') then
return
end
if not blind:GetAttribute('OriginalSize') then -- you could implement this in some other way but im lazy
blind:SetAttribute('OriginalSize', blind.Size)
blind:SetAttribute('OriginalCFrame', blind.CFrame)
end
if blind:GetAttribute('Open') then
blind:SetAttribute('Open', false) -- the blind is open so we close it
tweenService:Create(blind, TweenInfo.new(TWEEN_DURATION), { Size = blind:GetAttribute('OriginalSize'); CFrame = blind:GetAttribute('OriginalCFrame'); }):Play()
else
blind:SetAttribute('Open', true) -- the blind is closed so we open it
local originalSize = blind:GetAttribute('OriginalSize')
local originalCFrame = blind:GetAttribute('OriginalCFrame')
-- 1. calculate the difference between the original size and the target size
local sizeDifference = originalSize.Y - TARGET_SIZE_Y
local targetCFrame = originalCFrame - originalCFrame.UpVector * sizeDifference * 0.5 -- we are scaling it opposite to the part's Y axis
local targetSize = Vector3.new(originalSize.X, TARGET_SIZE_Y, originalSize.Z)
tweenService:Create(blind, TweenInfo.new(TWEEN_DURATION), { Size = targetSize; CFrame = targetCFrame }):Play()
end
end)
yeah have a good day i guess