How do I make all seats with the same name play the same animation?
03 | local Players = game:GetService( "Players" ) |
04 | local SitIdleAnim = 2506281703 |
07 | [ workspace:FindFirstChild( 'Seat1' , true ) ] = 4623559126 ; |
08 | [ workspace:FindFirstChild( 'Seat2' , true ) ] = 913402848 ; |
12 | Players.PlayerAdded:Connect( function (Player) |
13 | Player.CharacterAdded:Connect( function (Character) |
14 | local Animation = Character:FindFirstChild( 'SitAnim' , true ) |
15 | local Humanoid = Character.Humanoid |
17 | Humanoid:GetPropertyChangedSignal( 'SeatPart' ):Connect( function () |
18 | local AnimationValue = Seats [ Humanoid.SeatPart ] |
19 | if not AnimationValue then |
I currently have this script which allows seat1 to play a resting animation and seat2 to play a walking animation.
Upon cloning and having multiple seats named "seat1" and "seat2", the original seat1 works fine; plays the correct animation and same goes for original seat2. The cloned seats however plays the "SitIdleAnim". The cloned and original seats are both the same; I used Ctrl+D, didn't change the name.
How would the script be altered/changed/edited to be able to allow every seat named "seat1" to play the "seat1" animation and same goes for seat2?
Thanks in advance.
- Sorry if I formatted this wrong, I'm a new user learning the basics of ScriptingHelpers. Please tell me if you don't understand.