Hi!
I’m trying to make a switch to open/close a set of blinds in a store I’m making. However, I’ve discovered that the script is completely crashing my studio whenever I press run, play, or play here. When I remove the script, the game runs perfectly normal, not slowed down at all. The weird thing is, I have 4 other scripts that are nearly just like this, but they are inside the door part, not a different part. Here is the script:
local cd = script.Parent
local Service = game:GetService("TweenService")
local Info = TweenInfo.new(3, Enum.EasingStyle.Linear)
local Door = script.Parent.Parent.Parent.BLIND1
local Door2 = script.Parent.Parent.Parent.BLIND2
local Original = {Size = Vector3.new(0.15, 0.375, 28.7), Position = Vector3.new(Door.Position.X, Door.Position.Y, Door.Position.Z)}
local Change = {Size = Vector3.new(0.15, 5.825, 28.9), Position = Vector3.new(Door.Position.X, Door.Position.Y - 2.7, Door.Position.Z)}
local Original2 = {Size = Vector3.new(0.15, 0.375, 28.7), Position = Vector3.new(Door2.Position.X, Door2.Position.Y, Door2.Position.Z)}
local Change2 = {Size = Vector3.new(0.15, 5.825, 28.9), Position = Vector3.new(Door2.Position.X, Door2.Position.Y - 2.7, Door2.Position.Z)}
local Tween = Service:Create(Door, Info, Change)
local Tween2 = Service:Create(Door2, Info, Change2)
local bool = script.Parent.Parent.bool
function onMouseClick()
if bool.Value == false then
bool.Value = true
else
bool.Value = false
end
end
while true do
if bool.Value == true then
Tween:Play()
Tween2:Play()
else
local Tween = Service:Create(Door, Info, Original)
local Tween2 = Service:Create(Door2, Info, Original2)
Tween:Play()
Tween2:Play()
end
end
cd.MouseClick:connect(onMouseClick)
And a pic of the explorer:
Any help is much appreciated!