local man = script.Parent game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player) print('FIN') local parts = game.Workspace.box.bust:GetChildren() for i,v in pairs(parts) do v.Anchored = false end print("hi") wait(0) local tweenService = game:GetService("TweenService") local part = script.Parent local tweeningInformation = TweenInfo.new( 2, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0) local tweeningProperties = { ["Position"] = Vector3.new(-8.572, 17.175, 6.652); } local Tween = tweenService:Create(part,tweeningInformation,tweeningProperties) Tween:Play() man.Anchored = true Tween.Completed:connect(function() --local search = game.Workspace:FindFirstChildWhichIsA("Model") --local root = search:WaitForChild("HumanoidRootPart") repeat local part1 = script.Parent local tweeningInformation1 = TweenInfo.new( 0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0) local tweeningProperties1 = { ["Position"] = Vector3.new(player.Character.HumanoidRootPart.Position); --player from the remoteevent client to server data transfer } local Tween1 = tweenService:Create(part1,tweeningInformation1,tweeningProperties1) Tween1:Play() print("lopp") wait(1) until script.Parent.clear.Value == true end) end)
No errors but it just doesnt move from the spot where player spawned but print (lopp) like it should
Everything's fine, the only thing is that you'll need some kind of loop for it to constantly follow the player.
You can accomplish this, by adding a loop, I'm going to be using a while loop
local man = script.Parent game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player) print('FIN') local parts = game.Workspace.box.bust:GetChildren() for i,v in pairs(parts) do v.Anchored = false end print("hi") wait(0) local tweenService = game:GetService("TweenService") local part = script.Parent local tweeningInformation = TweenInfo.new( 2, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0) local tweeningProperties = { ["Position"] = Vector3.new(-8.572, 17.175, 6.652); } local Tween = tweenService:Create(part,tweeningInformation,tweeningProperties) Tween:Play() man.Anchored = true Tween.Completed:connect(function() --local search = game.Workspace:FindFirstChildWhichIsA("Model") --local root = search:WaitForChild("HumanoidRootPart") repeat local part1 = script.Parent local tweeningInformation1 = TweenInfo.new( 0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0) local tweeningProperties1 = { ["Position"] = Vector3.new(player.Character.HumanoidRootPart.Position); --player from the remoteevent client to server data transfer } local Tween1 = tweenService:Create(part1,tweeningInformation1,tweeningProperties1) Tween1:Play() print("lopp") wait(1) until nil end) end)
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player) print('FIN') local parts = game.Workspace.box.bust:GetChildren() for i,v in pairs(parts) do v.Anchored = false end local Player = game:GetService("Players").PlayerAdded:Connect(function(player) local Character = player.Character or player.CharacterAdded:Wait() while wait(3) do -- change it to the amount of secs you want it to wait local root = Character:WaitForChild("HumanoidRootPart") local tweenService = game:GetService("TweenService") local part = script.Parent part.Position = root.Position local tweeningInformation = TweenInfo.new( 2, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1, false, 1) local tweeningProperties = { ["Position"] = Vector3.new(-8.572, 17.175, 6.652); } local Tween = tweenService:Create(part,tweeningInformation,tweeningProperties) Tween:Play() part.Anchored = true Tween.Completed:connect(function() local search = game.Workspace:FindFirstChildWhichIsA("Model") local root = Character:WaitForChild("HumanoidRootPart") local part1 = script.Parent local tweeningInformation1 = TweenInfo.new( 0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 1) local tweeningProperties1 = { ["Position"] = Vector3.new(root.Position) --player from the remoteevent client to server data transfer } local Tween1 = tweenService:Create(part1,tweeningInformation1,tweeningProperties1) Tween1:Play() print("lopp") wait(1) end) end end) end)
@JesseSong I edited the script a bit, but nothing happens except the wall falling