Script wont work past the first line

it prints all the numbers and yes i am hitting the slide with the keycard or it wouldnt print 3 and 4

Are there any new errors in the console coming from the script?

no errors, but i did somehow get it to work except it plays reverseTween twice. the script is the same as this one, it must have been a typo or something. . .but i checked all the spellings. . .whatever, it works now. i will make some changes to figure out why its playing twice but here is the script (for now)

:sweat_smile:

print("1")
local parkAccessories = game.Workspace:FindFirstChild("Park Accesories")
local Part = parkAccessories:FindFirstChild("KeycardDoor").DoorPart
local keycardDoor = parkAccessories:FindFirstChild("KeycardDoor")
local slide = keycardDoor:FindFirstChild("Slide") 

local TweenService = game:GetService("TweenService") 

local TweenInfo = TweenInfo.new(
	2,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out,
	1,
	false,
	1
) 

local goal = {Position = keycardDoor:FindFirstChild("DoorOpen").Position}
local reverseGoal ={Position = keycardDoor:FindFirstChild("DoorClose").Position}

local Tween = TweenService:Create(Part, TweenInfo, goal)

local reverseTween = TweenService:Create(Part, TweenInfo, reverseGoal)
print("2")

local deb = false

slide.Touched:Connect(function(hit)
	if deb == false then
		deb = true
		if hit.Parent.Name == "Keycard" then
			print("3")
			Tween:Play()
			wait(3)
			reverseTween:Play()
			print("4")
		end
	end
end)

reverseTween.Completed:Connect(function()
	deb = false
end)

this might stop it from doing it twice (I just added that when the tween starts, it doesn’t allow it to play the tween again, then when the reverseTween is finsished it can play again)

1 Like

sadly, it still does the same thing
robloxapp-20240524-1030321.wmv (1.2 MB)

then when i try again, it doesnt even play the Tween, just the reverseTween, and it plays twice

i found the solution!

using @Pro3taco’s script but changing the delayTime and repeatCount of the tween to 0.

Glad that I could help you!

CharLImit

CharLimit

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.