Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function move()
- while wait(0) do
- if not paused then
- if not running then break end
- local dt = time() - t
- t = time()
- for i, v in pairs(chars:GetChildren()) do
- if v.Visible then
- local s = v.AbsoluteSize
- local p = v.AbsolutePosition
- local m = .25 / (chars["P"..i].AbsoluteSize.X/20)
- if gui.Controls["P"..i.."Right"].TextButton.Text ~= "" and gui.Controls["P"..i.."Right"].TextButton.Text ~= "|" and buttons(gui.Controls["P"..i.."Right"].TextButton.Text) and F[i].X == 0 then
- F[i] = F[i] + Vector2.new(8 + F[i].X, 0)
- elseif gui.Controls["P"..i.."Left"].TextButton.Text ~= "|" and gui.Controls["P"..i.."Left"].TextButton.Text ~= "" and buttons(gui.Controls["P"..i.."Left"].TextButton.Text) and F[i].X == 0 then
- F[i] = F[i] - Vector2.new(8 + F[i].X, 0)
- elseif Vf[i].X ~= 0 then
- F[i] = Vector2.new(0, F[i].Y)
- Vf[i] = Vf[i] - Vector2.new(.25 * (math.abs(Vf[i].X)/Vf[i].X), 0)
- if Vf[i].X < .25 and Vf[i].X > -.25 then
- Vf[i] = Vector2.new(0, Vf[i].Y)
- end
- end
- if F[i].X > 0 then
- v.Gun.Position = UDim2.new(1,0,0,12)
- elseif F[i].X < 0 then
- v.Gun.Position = UDim2.new(0, -12, 0, 12)
- end
- if F[i].Y == 0 and Vf[i].Y == 0 and gui.Controls["P"..i.."Jump"].TextButton.Text ~= "" and gui.Controls["P"..i.."Jump"].TextButton.Text ~= "|" and buttons(gui.Controls["P"..i.."Jump"].TextButton.Text) then
- local run = false
- for z, x in pairs(gui[ground]:GetChildren()) do
- if not x:IsA("Folder") then
- if s.Y + p.Y == x.AbsolutePosition.Y then
- run = true
- break
- end
- end
- end
- if run then
- F[i] = F[i] - Vector2.new(0, 11)
- end
- end
- if F[i].Y < 10 then
- F[i] = F[i] + Vector2.new(0, 1)
- end
- Vf[i] = Vf[i] + Vector2.new(F[i].X * (dt/m), F[i].Y * (dt/m))
- if Vf[i].X > 20 or Vf[i].X < -20 then
- Vf[i] = Vector2.new(20 * (math.abs(Vf[i].X)/Vf[i].X), Vf[i].Y)
- end
- for z, x in pairs(gui[ground]:GetChildren()) do
- if not x:IsA("Folder") then
- collision(v, x, p, s, i)
- end
- end
- v.Position = UDim2.new(0, Vf[i].X + v.AbsolutePosition.X, 0, Vf[i].Y + v.AbsolutePosition.Y)
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement