No errors, just doesnt teleport me though everything else works fine :)
The script in workspace:
01 | local thicc = 31 |
02 | local function Damn() wait( 30 ) end |
03 | Damn(thicc) |
04 | if game.Workspace.Time.Value = = 0 then |
05 | target = CFrame.new( 80.04 , 0.5 , - 63.9 ) --could be near a brick or in a new area |
06 | for i, player in ipairs (game.Players:GetChildren()) do |
07 |
08 | if player.Character and player.Character:FindFirstChild( "HumanoidRootPart" ) then |
09 |
10 | player.Character.HumanoidRootPart.CFrame = target |
11 | end |
12 | end |
13 | end |
1 | wait( 31 ) |
2 | target = CFrame.new( 80.04 , 0.5 , - 63.9 ) --could be near a brick or in a new area |
3 | for i, player in ipairs (game.Players:GetChildren()) do |
4 | if player.Character and player.Character:FindFirstChild( "HumanoidRootPart" ) then |
5 | player.Character.HumanoidRootPart.CFrame = target + Vector 3. new( 0 , i * 5 , 0 ) |
6 | end |
7 | end |
So your if statement is only running once which means the Value can change at any time and do nothing. So for that reason we are going to use .Changed
01 | local function Damn() |
02 | wait( 30 ) |
03 | end |
04 | Damn() |
05 | local ObjectValue = game.Workspace.Time |
06 |
07 | ObjectValue.Changed:Connect( |
08 | function () --Parameter of property is not needed |
09 | if ObjectValueValue = = 0 then |
10 | target = CFrame.new( 80.04 , 0.5 , - 63.9 ) |
11 | for i, player in ipairs (game.Players:GetPlayers()) do |
12 | if player.Character and player.Character:FindFirstChild( "HumanoidRootPart" ) then |
13 | player.Character.HumanoidRootPart.CFrame = target |
14 | end |
15 | end |
16 | end |
17 | end |
18 | ) |
Basically, we wait 30 seconds then connect the .Changed event for every time the value changes it will fire the Signal.
Maybe this, used Players:GetPlayers() instead, but does Workspace.Time exist and is it a NumberValue?
01 | local Players = game:GetService( "Players" ) -- Add Players to a local function |
02 | local thicc = 31 -- This has no use but useful for the OP? |
03 | wait( 30 ) -- No use for the "Damn" function |
04 | local target |
05 | if workspace.Time.Value = = 0 then -- use workspace rather than game.Workspace |
06 | target = CFrame.new( 80.04 , 0.5 , - 63.9 ) |
07 | for _, plr in pairs (Players:GetPlayers()) do |
08 | if plr.Character and plr.Character:FindFirstChild( "HumanoidRootPart" ) then |
09 | plr.Character:SetPrimaryPartCFrame(target) |
10 | end |
11 | end |
12 | end |