so I have this script:
local Animation = game.Workspace.Animation
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local Part = game.Workspace:WaitForChild("Parts")
game.Workspace.Part.Touched:Connect(function(touched)
if touched.Parent:FindFirstChild("Humanoid") then
local AnimPlay = touched.Parent.Humanoid:LoadAnimation(Animation)
touched.Parent.HumanoidRootPart.Anchored = true
AnimPlay:Play()
AnimPlay.Stopped:wait() --Waits until it finished playing
touched.Parent.HumanoidRootPart.Anchored = false
player.TeamColor = BrickColor.new("Really red")
if player.TeamColor == BrickColor.new("Really red") then
script.Disabled = true
if player.TeamColor == BrickColor.new("White") then
script.Disabled = false
end
end
end
end)
At this line here i think)
game.Workspace.Part.Touched:Connect(function(touched)
Instead of part how could I do all the parts inside a folder?