(Sorry if I did this incorrectly)
So I was chilling in Studio when I thought of trying to make a door opening animation.
The problem is… I don’t know how to make it happen if the key pressed detection goes in another script.
Here is my door opening animation:
local TweenService = game:GetService("TweenService")
local door = script.Parent
local userInputService = game:GetService("UserInputService")
local openDoorTweenInfo = TweenInfo.new(
2,
Enum.EasingStyle.Bounce,
Enum.EasingDirection.InOut,
0,
false,
1
)
local ending =
{
Orientation = Vector3.new(0,-90,0);
Position = Vector3.new(-107.5,5,-31.5)
}
local openDoor = TweenService:Create(door, openDoorTweenInfo, ending)
That works, but now I want to make it happen when a player presses E on their keyboard.
But that only works on a LocalScript (I added a script under the door). How can I achieve this?