local player = game.Players.LocalPlayer
db = false
game.ReplicatedStorage.PlayerRail.OnClientEvent:Connect(function(playerac, name)
print("good")
db = false
for i = 1, 6 do
if db == false then
player.Character.HumanoidRootPart.Anchored = true
local crusher = game.Players.LocalPlayer.Character.HumanoidRootPart
crusher.CFrame = game.Workspace.Rails:WaitForChild(name):WaitForChild(i):WaitForChild("Attachment1").CFrame
local TweenService = game:GetService("TweenService")
local crushinfo = TweenInfo.new(
0.5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local crushgoal = {
CFrame = game.Workspace.Rails:WaitForChild(name):WaitForChild(i):WaitForChild("Attachment").CFrame
}
local tween = TweenService:Create(crusher, crushinfo, crushgoal)
tween:play()
end
wait(0.5)
end
end)
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Space then
db = true
player.Character.HumanoidRootPart.Anchored = false
end
end)
The error is on line 11