Hi! So, I have this script:
local ws = game.Workspace
local value1 = ws.firstvalve.Value
local value2 = ws.secondvalve.Value
local value3 = ws.thirdvalve.Value
local value4 = ws.fourthvalve.Value
local value5 = ws.fifthvalve.Value
local TweenService = game:GetService("TweenService")
local door = workspace.Bigmetaldoor
local doorRoot = door.PrimaryPart
local DoorSwingInfo = TweenInfo.new()
local DoorSwingTween = TweenService:Create(doorRoot, DoorSwingInfo, {
CFrame = doorRoot.CFrame * CFrame.Angles(0, math.rad(-35),0)
})
local opensound = game.Workspace.Bigmetaldoor.Door.metaldooropen
print("start")
if value1.Value == true and value2.Value == true then
script.firstsecond.Value = true
print("count")
end
if value3.Value == true and value4.Value == true then
script.thirdfourth.Value = true
print("count")
end
if script.thirdfourth.Value == true and value5.Value == true then
script.firstfifth.Value = true
print("count")
end
if script.firstsecond.Value == true and script.thirdfourth.Value == true then
script.second.Value = true
print("count")
end
if script.second.Value == true and script.firstfifth.Value == true then
script.all.Value = true
print("count")
end
if script.all.Value == true then
DoorSwingTween:Play()
opensound:Play()
print("done")
end
What do I want to achieve?
I want to have an script, that checks if all 5 (value1, value2, and so on till 5) conditions are true, and if they are then it should play some animation,etc…
What is the issue?
Currently the issue is when i change the values to True by activating a proximity prompt, then it won’t work. But if I change the values to True by the script like this:
value5.Value = true
value4.Value = true
value3.Value = true
value2.Value = true
value1.Value = true
Then it works…
Useful informations:
Those values are turning to True, when you activate a proximity prompt.
The values which are seen above are a BoolValue.
If you need any more information, please leave a reply!
Thanks for reading!